capture-screen.md 1.1 KB
Newer Older
D
DCloud_LXH 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
## uni.onUserCaptureScreen(callback?) @onusercapturescreen

<!-- UTSAPIJSON.onUserCaptureScreen.description -->

<!-- UTSAPIJSON.onUserCaptureScreen.compatibility -->

<!-- UTSAPIJSON.onUserCaptureScreen.param -->

<!-- UTSAPIJSON.onUserCaptureScreen.returnValue -->

<!-- UTSAPIJSON.onUserCaptureScreen.tutorial -->

## uni.offUserCaptureScreen(callback?) @offusercapturescreen

<!-- UTSAPIJSON.offUserCaptureScreen.description -->

<!-- UTSAPIJSON.offUserCaptureScreen.compatibility -->

<!-- UTSAPIJSON.offUserCaptureScreen.param -->

<!-- UTSAPIJSON.offUserCaptureScreen.returnValue -->

<!-- UTSAPIJSON.offUserCaptureScreen.tutorial -->

<!-- UTSAPIJSON.general_type.name -->

<!-- UTSAPIJSON.general_type.param -->

## tips
30
- 本文的截屏指手机自带的截屏事件的监听和取消监听,由用户操作手机按键触发。App平台如需通过代码对view截屏,另见API [takeSnapshot](../dom/unielement.md#takesnapshot)
DCloud_Heavensoft's avatar
DCloud_Heavensoft 已提交
31
- 如果想防止截屏,一般是监听到截屏事件后,立即修改当前界面内容,这样即便截屏也截不到你想要保护的内容