uni.onMemoryWarning(UTSCallback)
开启监听内存警告
本 API 是 uni ext api,需下载插件:uni-memorywarning
参数
MemoryWarningCallbackResult 的属性值
名称 | 类型 | 必备 | 默认值 | 描述 |
level | number | 是 | - | 内存警告等级(仅安卓平台有效,iOS始终是0) |
onMemoryWarning 兼容性
Android | iOS | web |
3.9.0 | 4.11 | - |
参见
相关 Bug
uni.offMemoryWarning(callback?)
取消监听内存不足告警事件
本 API 是 uni ext api,需下载插件:uni-memorywarning
参数
MemoryWarningCallbackResult 的属性值
名称 | 类型 | 必备 | 默认值 | 描述 |
level | number | 是 | - | 内存警告等级(仅安卓平台有效,iOS始终是0) |
offMemoryWarning 兼容性
Android | iOS | web |
3.9.0 | 4.11 | - |
参见
相关 Bug
通用类型
GeneralCallbackResult
名称 | 类型 | 必备 | 默认值 | 描述 |
errMsg | string | 是 | - | 错误信息 |