Lock application orientation to landscape and sensor only
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?
精彩评论