android - 无论Android / React Native中的自动旋转如何将方向设置为纵向模式
问题描述
我想portrait mode
在我的 react native android 应用程序中设置,我试图
android:screenOrientation="portrait"
在我的 AndroidManifest.xml
文件中设置,- 在我的活动中以编程方式添加方向,
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
但这些都不起作用。
注意:我已经react-native-navigation
在我的项目中添加了
任何输入来解决这个问题?谢谢。
解决方案
如果你使用 react-native-navigation,试试这个
Navigation.setDefaultOptions({
layout: {
orientation: ["portrait"],
},
});
在此处查看文档。
推荐阅读
- python-3.x - 在没有 id 和值的情况下在 selenium 中提交按钮
- azure - 如何为 Azure 容器实例应用带有自定义域的 https?
- r - 逐字确定多字串的(不)相似性
- asp.net - 我们可以隐藏 Content-Security-Policy 错误日志的 URL 吗?
- matlab - 通过 GPML 实现 4-D 高斯过程回归的问题
- javascript - 如何在构建模式下以不同方式加载 index.html 中的外部脚本文件?(Vue.js)
- mysql - MySql - 在列别名中使用数据库名称
- android - 如何停止阻塞的活页夹线程?
- android - Android FCM 推送日志
- mysql - 将使用另一个表中的值添加新行的 SQL 查询