안드로이드/Screen & Resolution
화면의 가로보기 & 세로보기 XML 파일 작성하기.
설.현.아빠
2011. 2. 11. 09:53
res/layout 디렉토리와 res/layout-land디렉토리에 각각의 가로 세로 화면 XML파일을 작성한다. 아래와 같이 작성하였을 경우 vertical.xml은 화면이 세로일때 버튼을 세로로 정렬시키고, horizontal.xml은 화면이 가로일때 버튼을 가로로 정렬시키게 된다. res/layout/vertical.xml <?xml version="1.0 encoding="utf-8"?> <LinearLayout android:orientation = "vertical" ... > <Button ... /> <Button ... /> </LinearLayout> res/layout/horizontal.xml <?xml version="1.0 encoding="utf-8"?> <LinearLayout android:orientation = "horizontal" ... > <Button ... /> <Button ... /> </LinearLayout>