2014-11-05 63 views
0

我希望能夠在風景模式中選擇WHICH方向旋轉到。我有一個特定的情況,設備將是風景,但它看起來顛倒了我想要的。加速度計似乎沒有工作。

請注意:這是針對不在Google Play商店中的特定企業應用。Android選擇特定的風景方向

到目前爲止我的代碼(在清單中,應用程序標籤下):

android:screenOrientation="landscape" 

我已經看過以下職位:
How can i rotate the particular view landscape or portrait programatically in android?
Android screen orientation: forcing landscape?

回答

1

你的線路應該在活動標籤(每個如果你有幾個)。你也可以使用

機器人:screenOrientation = 「sensorLandscape」

API 9,在舊版本中,它會是 「正常」 的景觀

1

以下是代碼,我僅用於將您的活動顯示爲橫向模式

<activity android:screenOrientation="landscape" 
android:configChanges="orientation|keyboardHidden" 
android:name="yourActivty"/> 
+0

是謝謝你 - 我已經有這個,如前所述在我的問題 – 2014-11-05 13:14:13