안드로이드는 화면에 따라 2가지 레이아웃을 만들어 주어야 합니다.
가로 일때와 세로일때 인데요.
구현 컨셉상으로 한방향으로만 레이아웃을 구현해야 할 경우, AndroidManifest에서
screenOrientation 속성을 부여함 으로써 화면 고정이 가능합니다.
//세로 화면
<Activity android:name=".classname"
android:screenOrientation="portrait"/>
//가로 화면
<Activity android:name=".classname"
android:screenOrientation="landscape"/>
대표적으로는 두개만 사용하지만 총 7가지의 종류가 있습니다.
그 종류는 다음과 같습니다.
"unspecified " |
The default value. The system chooses the orientation. The policy it uses, and therefore the choices made in specific contexts, may differ from device to device. |
"landscape " |
Landscape orientation (the display is wider than it is tall). |
"portrait " |
Portrait orientation (the display is taller than it is wide). |
"user " |
The user's current preferred orientation. |
"behind " |
The same orientation as the activity that's immediately beneath it in the activity stack. |
"sensor " |
The orientation determined by a physical orientation sensor. The orientation of the display depends on how the user is holding the device; it changes when the user rotates the device. |
"nosensor " |
An orientation determined without reference to a physical orientation sensor. The sensor is ignored, so the display will not rotate based on how the user moves the device. Except for this distinction, the system chooses the orientation using the same policy as for the "unspecified " setting. |