如何在React Native中禁用旋转? [英] how to disable rotation in React Native?

查看:110
本文介绍了如何在React Native中禁用旋转?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只支持纵向视图.我该如何使React Native应用程序不自动旋转? 我尝试搜索文档和Github问题,但没有发现任何帮助.

I would like to support only portrait view. How can I make a React Native app not to autorotate? I tried searching documentation and Github issues, but I didn't find anything helpful.

推荐答案

React Native应用程序几乎只是一个普通的iOS应用程序,因此您可以采用与其他所有应用程序完全相同的方式来进行操作.只需在常规应用程序属性中取消选中(在XCode中)"Landscape Left"和"Landscape Right"即可:

React Native app is pretty much just a normal iOS application, so you can do it in exactly the same way as you do for all other apps. Simply uncheck (in XCode) the "Landscape Left" and "Landscape Right" as allowed Device Orientations in the General application properties:

这篇关于如何在React Native中禁用旋转?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆