Android 屏幕實(shí)現(xiàn)上下翻轉(zhuǎn)
Android 屏幕實(shí)現(xiàn)上下翻轉(zhuǎn)
通常我們的應(yīng)用只會(huì)設(shè)計(jì)成橫屏或者豎屏,鎖定橫屏或豎屏的方法是在manifest.xml文件中設(shè)定屬性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>
其實(shí)screenOrientation還可以設(shè)置成很多值:
android:screenOrientation = ["unspecified" | "behind" |
"landscape" | "portrait" |
"reverseLandscape" | "reversePortrait" |
"sensorLandscape" | "sensorPortrait" |
"userLandscape" | "userPortrait" |
"sensor" | "fullSensor" | "nosensor" |
"user" | "fullUser" | "locked"]
其中sensorLandscape就是橫屏根據(jù)重力上下翻轉(zhuǎn),sensorPortrait豎屏根據(jù)重力上下翻轉(zhuǎn)。
如果有興趣,你也可以試試其他的值哦...
感謝閱讀,希望能幫助到大家,謝謝大家對(duì)本站的支持!
- Android實(shí)現(xiàn)dialog的3D翻轉(zhuǎn)示例
- Android ViewFlipper翻轉(zhuǎn)視圖使用詳解
- Android實(shí)現(xiàn)卡片翻轉(zhuǎn)動(dòng)畫
- Android實(shí)現(xiàn)文字翻轉(zhuǎn)動(dòng)畫的效果
- Android利用Camera實(shí)現(xiàn)中軸3D卡牌翻轉(zhuǎn)效果
- Android實(shí)現(xiàn)圖片反轉(zhuǎn)、翻轉(zhuǎn)、旋轉(zhuǎn)、放大和縮小
- Android實(shí)現(xiàn)Flip翻轉(zhuǎn)動(dòng)畫效果
- Android動(dòng)畫之3D翻轉(zhuǎn)效果實(shí)現(xiàn)函數(shù)分析
- Android圖片翻轉(zhuǎn)動(dòng)畫簡(jiǎn)易實(shí)現(xiàn)代碼
- Android實(shí)現(xiàn)3D翻轉(zhuǎn)動(dòng)畫效果
相關(guān)文章
淺析Android 手機(jī)衛(wèi)士設(shè)備管理權(quán)限鎖屏
這篇文章主要介紹了淺析Android 手機(jī)衛(wèi)士設(shè)備管理權(quán)限鎖屏的相關(guān)資料,需要的朋友可以參考下2016-04-04
Flutter通過(guò)Container實(shí)現(xiàn)時(shí)間軸效果
時(shí)間軸是前端UI經(jīng)常用到的效果,本文講解下Flutter如何通過(guò)Container實(shí)現(xiàn),感興趣的朋友可以了解下2021-05-05
Kotlin?this關(guān)鍵字的使用實(shí)例詳解
這篇文章主要介紹了Kotlin?this關(guān)鍵字的使用實(shí)例,在Kotlin中,this關(guān)鍵字允許我們引用一個(gè)類的實(shí)例,該類的函數(shù)恰好正在運(yùn)行。此外,還有其他方式可以使this表達(dá)式派上用場(chǎng)2023-02-02
Android自定義ViewGroup之CustomGridLayout(一)
這篇文章主要為大家詳細(xì)介紹了Android自定義ViewGroup之CustomGridLayout的相關(guān)資料,感興趣的小伙伴們可以參考一下2016-09-09
聊聊GridView實(shí)現(xiàn)拖拽排序及數(shù)據(jù)交互的問(wèn)題
這篇文章主要介紹了聊聊GridView實(shí)現(xiàn)拖拽排序及數(shù)據(jù)交互的問(wèn)題,整體實(shí)現(xiàn)思路是通過(guò)在一個(gè)容器里放置兩個(gè)dragview,DragView里面進(jìn)行View的動(dòng)態(tài)交換以及數(shù)據(jù)交換,具體實(shí)現(xiàn)代碼跟隨小編一起看看吧2021-11-11

