activity裡設置android:screenOrientation的值。
android:screenOrientation
的屬性有以下值:
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,
橫屏
portrait,
豎屏
user(
用戶當前設置的orientation),The user's current preferred orientation.
behind(
下一個要顯示的Activityorientation),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(
不使用感測器,這個效果差不多等於unspecified).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.

 

arrow
arrow
    全站熱搜

    狼翔月影 發表在 痞客邦 留言(0) 人氣()