0.0.2 • Published 3 years ago
@mls7788/capacitor-plugin-screen-orientation v0.0.2
@mls/capacitor-plugin-screen-orientation
手机应用横屏,手写签字
Install
npm install @mls/capacitor-plugin-screen-orientation
npx cap sync
API
orientation()
lock(...)
unlock()
addListener('screenOrientationChange', ...)
removeAllListeners()
- Interfaces
orientation()
orientation() => Promise<{ type: OrientationType; }>
返回当前横屏、竖屏类型。
Returns: Promise<{ type: any; }>
lock(...)
lock(opts: { orientation: OrientationLockType; }) => Promise<void>
按照传入屏幕方向锁定。
Param | Type | Description |
---|---|---|
opts | { orientation: any; } | 屏幕方向类型。 |
unlock()
unlock() => Promise<void>
取消当前屏幕锁定。
addListener('screenOrientationChange', ...)
addListener(eventName: 'screenOrientationChange', listenerFunc: (orientation: { type: OrientationType; }) => void) => Promise<PluginListenerHandle> & PluginListenerHandle
监听屏幕方向改变。
Param | Type | Description |
---|---|---|
eventName | 'screenOrientationChange' | 事件名字 |
listenerFunc | (orientation: { type: any; }) => void | 事件执行方法 |
Returns: Promise<PluginListenerHandle> & PluginListenerHandle
removeAllListeners()
removeAllListeners() => Promise<void>
移除所有事件监听。
Interfaces
PluginListenerHandle
Prop | Type |
---|---|
remove | () => Promise<void> |
0.0.2
3 years ago