问题描述
是否可以在移动设备上将视口的方向锁定为纵向?
Is it possible to lock the view port's orientation to portrait on a mobile device?
我用Google搜索了它,但找不到确切的方法.
I Googled it but could not find out exactly how to do it.
推荐答案
根据我的经验,由于您正在通过浏览器访问网站,因此无法完成.浏览器本身应该具有锁定定位功能,例如Safari,Chrome.您的HTML CSS代码将无法控制它.
As my experience, it cannot be done as you are access the website from the browser. Which should have the lock orientation capability is the browser itself - e.g Safari, Chrome. Your HTML CSS code will not be feasible to control it.
例如,当您构建一个混合移动应用程序时-意味着一个具有html css和js的应用程序,然后将其转换为带有包装器的移动应用程序作为内部Web视图.这样便可以锁定屏幕方向.需要进行一些配置,稍后将这些配置转换为Objective C或Java.
For example when you are building a hybrid mobile app - meaning an application with html css and js then convert it to mobile app with wrapper as a web view inside. Then you are capable to lock the screen orientation. There are some configuration need to be done and later on these will be converted to Objective C or Java.
这篇关于如何在HTML5/CSS3中将视口锁定为纵向方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!