我已經讀過文檔,當我寫入android:screenOrientation="sensor"
時,表示方向取決於設備方向傳感器。顯示的方向取決於用戶握持設備的方式;它會在用戶旋轉設備時發生變化。但是,有些設備默認情況下不會旋轉到所有四種可能的方向。要允許全部四個方向,請使用「fullSensor」。 但是,當我運行應用程序,並將設備旋轉到橫向時,佈局不會更改,換句話說,android:screenOrientation="sensor"
不起作用。android:screenOrientation =「sensor」不起作用
0
A
回答
0
讀讀,
「傳感器」 - 方位由設備取向傳感器確定。顯示器的方向取決於用戶如何握住 設備;它會在用戶旋轉設備時發生變化。 儘管如此,一些設備 不會旋轉到所有四種可能的方向,默認情況下爲。 要允許所有四個方向,使用「fullSensor」。
。
「fullSensor」 - 方向取決於設備方位傳感器對4個方位的任何 。這是類似於「傳感器」 除了此 允許任何4個可能的屏幕取向,無論 什麼樣的設備通常做(例如,一些設備將不 通常使用反向縱向或逆景觀,但這使得 那些)。在API級別9
例如
<activity
android:name=".ui.MainActivity"
android:label="@string/app_name"
android:screenOrientation="fullSensor"
android:theme="@style/AppTheme.NoActionBar" />
相關問題
- 1. Airflow ExternalTaskSensor卡住
- 2. android:screenOrientation =「portrait」不能在一箇中文鍵盤上工作
- 3. MapServer SOS(Sensor Observation Service)配置
- 4. html5 geolocation gps sensor禁用while watchPosition()
- 5. 不起作用
- 6. 不起作用?
- 7. 不起作用?
- 8. 不起作用?
- 9. 如何爲相機設置android:screenOrientation =「portrait」
- 10. selenium.captureEntirePageScreenshot不起作用,但selenium.captureScreenshot起作用
- 11. ON_CALL不起作用,但EXPECT_CALL起作用
- 12. 副作用不起作用
- 13. android:screenOrientation =在舊操作系統版本上「鎖定」
- 14. android:screenOrientation =「portrait」在Jellybean中被忽略
- 15. 如何製作Android Sensor SensorEvent對象的副本
- 16. Document.querySelectorAll()不起作用
- 17. chart.interactiveLayer.tooltip.chartContainer不起作用?
- 18. dumpTreshold不起作用
- 19. ActionListener不起作用
- 20. suspendEvents不起作用
- 21. mysql_rollback()不起作用
- 22. RequestRouteToHost不起作用
- 23. spring.mvc.view.suffix不起作用
- 24. BluetoothLEAdvertisementWatcher不起作用
- 25. setText(「」)不起作用
- 26. viewPager.setCurrentItem()不起作用
- 27. ProcessStartInfo.CreateNoWindow不起作用
- 28. @ViewById不起作用
- 29. UIImpactFeedbackGenerator不起作用
- 30. @RolesAllowed不起作用
你用'機器人:screenOrientation = 「fullSensor」'? –
是否適合你? –