![](/img/trans.png)
[英]How to set up orientation in manifest for tablets as landscape and portrait for phones?
[英]How to set the Portrait and landscape orientation in android manifest file
縱向模式正在運行,橫向未顯示。
android:screenOrientation="portrait" // 這里我需要顯示縱向和橫向。
您可以使用:
android:screenOrientation="unspecified"
這是默認值,系統會選擇方向。
或者,您可以使用:
android:screenOrientation="fullSensor"
在這種情況下,設備方向傳感器確定屏幕方向。
嘗試其中一種,看看哪一種最適合您。
編輯:對於特定的 class,您可以這樣做:
<activity
android:name=".YOUR_CLASS"
android:screenOrientation="unspecified" // or what you want
android:theme="@style/Theme.Design.NoActionBar"/>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.