屏幕方向ios [英] Screen orientation ios

查看:140
本文介绍了屏幕方向ios的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用phonegap和jqm来处理ios的应用程序。我只想在一个页面上锁定屏幕方向到横向。其他页面必须锁定在肖像上。我看到一个插件可以做到这一点,但它只有可用于Android。

I am working on a application for ios with phonegap and jqm. I want to lock the screen orientation to landscape on just one page. The other pages have to be locked on portrait. I have seen a plugin that can do this but its only available for android.

我的问题?有没有办法在ios上这样做?

My question? Is there a way to also do this on ios?

提前感谢!

推荐答案

在这里查看一些JQM API ...(尚未测试)

Check some JQM API here...( haven't test yet )

http://api.jquerymobile.com/orientationchange/

Orientationchange时间

Orientationchange Timing

orientationchange事件的时间与客户端高度和宽度的变化相关,在不同的浏览器之间是不同的,虽然当前的实现将给你从window.orientation派生的event.orientation的正确的值。这意味着如果你的绑定依赖于高度和宽度的值,你可能要禁用orientationChange完全与$ .mobile.orientationChangeEnabled = false,让后备调整代码触发你的绑定。

The timing of the orientationchange event with relation to the change of the client height and width is different between browsers, though the current implementation will give you the correct value for event.orientation derived from window.orientation. This means that if your bindings are dependent on the height and width values you may want to disable orientationChange altogether with $.mobile.orientationChangeEnabled = false to let the fallback resize code trigger your bindings.

http://jquerymobile.com/demos/1.2.0 /docs/api/globalconfig.html

您可以通过使用jQuery的$ .extend方法扩展$ .mobile对象来覆盖默认设置。

You can override default settings by extending the $.mobile object using jQuery's $.extend method.

$(document).bind("mobileinit", function(){
  $.extend(  $.mobile , {
    foo: bar
  });
});

这篇关于屏幕方向ios的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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