如何在所有平台上仅将应用程序限制为仅纵向模式? [英] How to restrict app to portrait mode only in ionic for all platforms?

查看:80
本文介绍了如何在所有平台上仅将应用程序限制为仅纵向模式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究Ionic/Cordova,已将其添加到androidManifest.xml,但这对我不起作用,并且应用程序仍以两种方式显示

I'm working on Ionic/Cordova, I added this to androidManifest.xml but this didn't work for me and app is still showing in both ways

android:screenOrientation="portrait"

如何将我的应用仅限制为纵向模式?我已经检查了android,但无法正常工作

How can I restrict my app to portrait mode only? I have checked on android and it doesn't work

推荐答案

如果只想在所有设备上使用纵向模式,则应将此行添加到项目根文件夹的config.xml中.

If you want to restrict to portrait mode only on all devices you should add this line to the config.xml in your projects root folder.

<preference name="orientation" value="portrait" />

之后,请在命令行中键入以下文本来重建平台:

After that, please rebuild the platform by typing below text in command line:

ionic build

这篇关于如何在所有平台上仅将应用程序限制为仅纵向模式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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