Android: Disable rotations by 90°, but enable rotations by 180°

后端 未结 1 1188
旧巷少年郎
旧巷少年郎 2020-12-14 10:24

I would like to create an Android app (for a tablet) that should be only displayed in landscape orientation, e.g. the app should ignore rotations by 90°, but support rotatio

相关标签:
1条回答
  • 2020-12-14 10:50

    The new sensorLandscape screen orientation is apparently meant for this purpose.

    Eg, you could do:

    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
    

    Unfortunately, this is only available as of Android 2.3. I'm currently looking for a way to achieve this on Froyo.

    0 讨论(0)
提交回复
热议问题