开发者

Activity setRequestedOrientation landscape vs. reverseLandscape?

开发者 https://www.devze.com 2023-02-18 13:25 出处:网络
Is it possible to set an activity\'s orientation (either in the manifest or with setRequestedOrientation) and specify which landscape or portrait mode to use? I.e. can I choose the device\'s left or r

Is it possible to set an activity's orientation (either in the manifest or with setRequestedOrientation) and specify which landscape or portrait mode to use? I.e. can I choose the device's left or right side?

With 2.1 it doesn't seem possible, but I wondered if anyone had any workaro开发者_如何学编程unds?

And where is this used?


You could try setRequestedOrientation(8).

The attribute itself is from API 1, and the constant for reverseLandscape is from level 9. Without the constant it might still work? Idk, thought it might be worth a try.


When you define your Activity in the manifest you specify orientation.

<activity
    android:screenOrientation="landscape" />

will only show it in landscape.

0

精彩评论

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

关注公众号