[英]How to set the Portrait and landscape orientation in android manifest file
Portrait mode is working and landscape is not showing.纵向模式正在运行,横向未显示。
android:screenOrientation="portrait" // Here i need to show both portrait and landscape. android:screenOrientation="portrait" // 这里我需要显示纵向和横向。
You can use:您可以使用:
android:screenOrientation="unspecified"
This is the default value and the system chooses the orientation.这是默认值,系统会选择方向。
alternatively, you can use:或者,您可以使用:
android:screenOrientation="fullSensor"
In this case, device orientation sensor determinates the screen orientation.在这种情况下,设备方向传感器确定屏幕方向。
Try one and the other to see which one works best for you.尝试其中一种,看看哪一种最适合您。
EDIT: For a specific class, you can do this:编辑:对于特定的 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.