문제

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 workarounds?

And where is this used?

도움이 되었습니까?

해결책

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

<activity
    android:screenOrientation="landscape" />

will only show it in landscape.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top