mirror of
https://github.com/wangjunget/cordova-plugin-statusbar-height.git
synced 2024-10-05 15:25:37 +08:00
更新readme
This commit is contained in:
parent
32094253e3
commit
e6cde6639d
21
README.md
21
README.md
@ -15,6 +15,12 @@ cordova plugin add https://github.com/wangjunget/cordova-plugin-statusbar-height
|
||||
|
||||
## cordova.plugins.StatusBarHeight.getValue
|
||||
|
||||
### Description
|
||||
|
||||
获取状态栏高度值,值类型为设备独立像素值。
|
||||
|
||||
### Demo
|
||||
|
||||
```javascript
|
||||
document.addEventListener('deviceready', getStatusbarHeight, false);
|
||||
function getStatusbarHeight() {
|
||||
@ -28,7 +34,22 @@ function getStatusbarHeight() {
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
### Tips
|
||||
|
||||
* 该插件获取到的值为设备独立像素值,如需要物理像素值可自行转换
|
||||
|
||||
```javascript
|
||||
var value; // 插件获取到的独立像素值
|
||||
var pdr = window.devicePixelRatio; // 获取设备独立像素比
|
||||
var px = value * pdr; // 得到物理像素值
|
||||
```
|
||||
|
||||
|
||||
|
||||
### Supported Platforms
|
||||
|
||||
* andorid
|
||||
* ios
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user