Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_63159449
unidocs-zh
提交
7a59aa64
U
unidocs-zh
项目概览
m0_63159449
/
unidocs-zh
与 Fork 源项目一致
Fork自
DCloud / unidocs-zh
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
unidocs-zh
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7a59aa64
编写于
9月 19, 2022
作者:
Anne_LXM
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
更新on、off之类api
上级
fe30ac8a
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
399 addition
and
346 deletion
+399
-346
docs/api/key.md
docs/api/key.md
+105
-87
docs/api/system/accelerometer.md
docs/api/system/accelerometer.md
+107
-83
docs/api/system/capture-screen.md
docs/api/system/capture-screen.md
+41
-41
docs/api/system/compass.md
docs/api/system/compass.md
+82
-82
docs/api/system/memory.md
docs/api/system/memory.md
+64
-53
未找到文件。
docs/api/key.md
浏览文件 @
7a59aa64
...
...
@@ -21,7 +21,15 @@
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|HBuilderX 2.2.3+|x|基础库2.7+|x|x|x|√|√|√|
**CALLBACK 返回参数**
**参数**
function listener
键盘高度变化事件的监听函数
**参数**
Object res
|参数|类型|说明|
|:-|:-|:-|
...
...
@@ -45,10 +53,20 @@ uni.onKeyboardHeightChange(res => {
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|HBuilderX 3.1.0+|x|基础库2.9.2+|x|x|x|x|x|√|
**参数**
function listener
onKeyboardHeightChange 传入的监听函数。不传此参数则移除所有监听函数。
**示例代码**
```
js
uni
.
offKeyboardHeightChange
(
callback
)
const
listener
=
function
(
res
)
{
console
.
log
(
res
)
}
uni
.
onKeyboardHeightChange
(
listener
)
uni
.
offKeyboardHeightChange
(
listener
)
// 需传入与监听时同一个的函数对象
```
### uni.getSelectedTextRange(OBJECT) @getselectedtextrange
...
...
docs/api/system/accelerometer.md
浏览文件 @
7a59aa64
### uni.onAccelerometerChange(CALLBACK)
监听加速度数据,频率:5次/秒,接口调用后会自动开始监听,可使用
``uni.offAccelerometer``
取消监听。
**CALLBACK 返回参数**
**参数**
function listener
加速度数据事件的监听函数
**参数**
Object res
|参数|类型|说明|
|:-|:-|:-|
...
...
@@ -32,6 +40,22 @@ uni.onAccelerometerChange(function (res) {
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|HBuilderX 2.9.6+|HBuilderX 2.9.6+|基础库 2.9.3+|x|x|x|x|√|√|
**参数**
function listener
onAccelerometerChange 传入的监听函数。不传此参数则移除所有监听函数。
**示例**
```
javascript
const
listener
=
function
(
res
)
{
console
.
log
(
res
)
}
uni
.
onAccelerometerChange
(
listener
)
uni
.
offAccelerometerChange
(
listener
)
// 需传入与监听时同一个的函数对象
```
### uni.startAccelerometer(OBJECT)
开始监听加速度数据。
...
...
docs/api/system/capture-screen.md
浏览文件 @
7a59aa64
docs/api/system/compass.md
浏览文件 @
7a59aa64
docs/api/system/memory.md
浏览文件 @
7a59aa64
...
...
@@ -27,9 +27,10 @@
**代码示例**
```
javascript
uni
.
onMemoryWarning
(
function
()
{
console
.
log
(
'
onMemoryWarningReceive
'
)
})
const
callback
=
function
(
res
)
{
console
.
log
(
res
,
'
onMemoryWarningReceive
'
);
}
uni
.
onMemoryWarning
(
callback
);
```
### uni.offMemoryWarning(CALLBACK)
...
...
@@ -44,10 +45,20 @@ uni.onMemoryWarning(function () {
|x|x|√|√|√|x|x|√|√|
**参数**
|属性 | 类型|说明|
|-- |-- |-- |
| 回调函数| Function|内存不足告警事件的回调函数|
**代码示例**
```
javascript
const
callback
=
function
(
res
)
{
console
.
log
(
res
);
}
uni
.
onMemoryWarning
(
callback
);
// 和 onMemoryWarning 传入同一个函数即可
uni
.
offMemoryWarning
(
callback
);
```
**Tips**
-
`CALLBACK`
为调用
`uni.onMemoryWarning`
时传入的
`CALLBACK`
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录