您好,登錄后才能下訂單哦!
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ì)本站的支持!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。