android plugin 镜像,cordova-plugin-screen-orientation

标题说明屏幕方向设置屏幕方向AppVeyor Travis CIbb56b167155738c8123fc7e22f83a94f.png68747470733a2f2f7472617669732d63692e6f72672f6170616368652f636f72646f76612d706c7567696e2d73637265656e2d6f7269656e746174696f6e2e7376673f6272616e63683d6d6173746572 Cordova屏幕方向插件

Cordova插件以通用方式为 iOS。安卓和 windows UWP设置/锁定屏幕方向。 这个插件基于屏幕定向 API,所以API是当前的规范。

插件将以下内容添加到屏幕对象( window.screen ):// lock the device orientation.orientation.lock('portrait')// unlock the orientation.orientation.unlock()// current orientation.orientation

安装cordova plugin add cordova-plugin-screen-orientation

支持的方向 portrait

方向处于主 portrait 模式。的纵向二级

方向处于辅助 portrait 模式。 landscape

方向处于主 landscape 模式。景观二级

方向处于辅助 landscape 模式。

方向为纵向主( 传感器) 或者纵向辅助。

方向既可以是横向的,也可以是横向的辅助( 传感器)。

方向解锁- 支持所有方向。

用法// set to either landscapescreen.orientation.lock('landscape');// allow user rotatescreen.orientation.unlock();// access current orientationconsole.log('Orientation is '+screen.orientation.type);

事件

android和iOS都将在窗口对象上触发orientationchange事件。 对于这里版本的插件,如果需要通知,请使用窗口对象。

示例用法window.addEventListener("orientationchange", function(){

console.log(screen.orientation.type); // e.g. portrait});

还将'更改'事件侦听器添加到 screen.orientation 对象中。

示例用法screen.orientation.addEventListener('change', function(){

console.log(screen.orientation.type); // e.g. portrait});

// ORscreen.orientation.οnchange=function(){console.log(screen.orientation.type);

};

Android注释

Windows UWP注释

如果设备有某种加速度计,Windows 商店应用( windows UWP ) 将只显示方向改变。 "方向"的内部状态仍将保存,但实际屏幕不会旋转,除非设备支持它。旧版变更日志变更日志

2.0.0适用于 iOS,安卓和 Windows的通用 javascript。

1.4.2#101 在调用lockOrientation时使iOS按需要旋转

1.4.1#89 Fix cordova> = 3.6.3

1.4.0添加了 Windows 8.1支持

用于ios的#54 background 线程

#64 方向命名 Bug 固定

向iOS默认方向添加 portrait

1.3.5 -6插件添加到 npm

1.3.4自述文件更新

1.3.3#53 WP8支持

1.3.2#33 iOS8延迟块

1.3.0#23 iOS8闪烁

1.2.0 -1.2.1#19 iOS8崩溃

请求请求欢迎。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值