![](/img/trans.png)
[英]Android: How to force reverse portrait orientation even if the device auto-rotate screen is off?
[英]How to set orientation to portrait mode, regardless the auto-rotate in Android / React Native
我想在我的本機 android 應用程序中設置portrait mode
,我試圖
Manifest.xml
文件中設置android:screenOrientation="portrait"
,setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
但這些都不起作用。 注意:我在我的項目中添加了react-native-navigation
任何輸入來解決這個問題? 謝謝。
如果你使用的是 react-native-navigation,試試這個
Navigation.setDefaultOptions({
layout: {
orientation: ["portrait"],
},
});
檢查這里的文檔。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.