Android 屏幕實現上下翻轉
更新時間:2017年07月06日 09:28:45 作者:oracleot
這篇文章主要介紹了Android 屏幕實現上下翻轉的相關資料,需要的朋友可以參考下
Android 屏幕實現上下翻轉
通常我們的應用只會設計成橫屏或者豎屏,鎖定橫屏或豎屏的方法是在manifest.xml文件中設定屬性android:screenOrientation為"landscape"或"portrait":
<activity
android:name="com.example.kata1.MainActivity"
android:label="@string/app_name"
android:screenOrientation="landscape">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
其實screenOrientation還可以設置成很多值:
android:screenOrientation = ["unspecified" | "behind" |
"landscape" | "portrait" |
"reverseLandscape" | "reversePortrait" |
"sensorLandscape" | "sensorPortrait" |
"userLandscape" | "userPortrait" |
"sensor" | "fullSensor" | "nosensor" |
"user" | "fullUser" | "locked"]
其中sensorLandscape就是橫屏根據重力上下翻轉,sensorPortrait豎屏根據重力上下翻轉。
如果有興趣,你也可以試試其他的值哦...
感謝閱讀,希望能幫助到大家,謝謝大家對本站的支持!
相關文章
Android自定義ViewGroup之CustomGridLayout(一)
這篇文章主要為大家詳細介紹了Android自定義ViewGroup之CustomGridLayout的相關資料,感興趣的小伙伴們可以參考一下2016-09-09

