开发者

Lock application orientation to landscape and sensor only

开发者 https://www.devze.com 2023-02-05 13:41 出处:网络
I understand how to lock the application into landscape mode using android:screenOrientation= \"lanscape\" but how can I lock it to use both lan开发者_开发技巧dscape and sensor orientations, which all

I understand how to lock the application into landscape mode using android:screenOrientation= "lanscape" but how can I lock it to use both lan开发者_开发技巧dscape and sensor orientations, which allows me to switch between the landscape views and skip out the portrait views. I found somewhere there is an option for sensorLandscape orientation mode but don't know how to set this in the manifest.


Unfortunately, sensorLandscape is a newly added manifest option only available for Android 2.3. Link here. Perhaps you could add android:configChanges="orientation" to your activity, and in your onConfigurationChanged method, handle the changes only if you're at a 90 or 270 degree orientation?

0

精彩评论

暂无评论...
验证码 换一张
取 消