提交 18504a76 编写于 作者: study夏羽's avatar study夏羽

docs: api/ui.md 删除不支持文档

上级 199a98af
### uni.setBackgroundColor(OBJECT)
动态设置窗口的背景色。
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|快手小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|x|√|x|√|x|√|√|
**参数说明**
|属性|类型|默认值|必填|说明|
|:-|:-|:-|:-|:-|
|backgroundColor|String||否|窗口的背景色,必须为十六进制颜色值|
|backgroundColorTop|String||否|顶部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持|
|backgroundColorBottom|String||否|底部窗口的背景色,必须为十六进制颜色值,仅 iOS 支持|
|success|Function||否|接口调用成功的回调函数|
|fail|Function||否|接口调用失败的回调函数|
|complete|Function||否|接口调用结束的回调函数(调用成功、失败都会执行)|
**代码示例**
```javascript
uni.setBackgroundColor({
backgroundColor: '#ffffff',
backgroundColorTop: '#222222',
backgroundColorBottom: '#333333'
});
```
### uni.setBackgroundTextStyle(OBJECT)
动态设置下拉背景字体、loading 图的样式。
**平台差异说明**
|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序|QQ小程序|快手小程序|
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|x|x|√|x|√|x|√|√|
**参数说明**
|属性|类型|必填|说明|
|:-|:-|:-|:-|
|textStyle|String|是|下拉背景字体、loading 图的样式,值为:dark、light|
|success|Function|否|接口调用成功的回调函数|
|fail|Function|否|接口调用失败的回调函数|
|complete|Function|否|接口调用结束的回调函数(调用成功、失败都会执行)|
**代码示例**
```javascript
uni.setBackgroundTextStyle({
textStyle: 'dark' // 下拉背景字体、loading 图的样式为dark
})
```
#### getMenuButtonBoundingClientRect()
在小程序平台,如果原生导航栏被隐藏,仍然在右上角会有一个悬浮按钮,微信下也被称为胶囊按钮。本API用于获取小程序下该菜单按钮的布局位置信息,方便开发者布局顶部内容时避开该按钮。
坐标信息以屏幕左上角为原点。
**平台差异说明**
|App |H5 |微信小程序 |支付宝小程序 |百度小程序 |字节跳动小程序 |QQ小程序 |
|:-: |:-:|:-: |:-: |:-: |:-: |:-: |
|x |x |√ |x |√ |√ |√ |
**返回值说明**
|属性 |类型 |说明 |
|:-: |:-: |:-: |
|width |number |宽度,单位:px |
|height |number |高度,单位:px |
|top |number |上边界坐标,单位:px |
|right |number |右边界坐标,单位:px |
|bottom |number |下边界坐标,单位:px |
|left |number |左边界坐标,单位:px |
**示例**
```javascript
let menuButtonInfo = uni.getMenuButtonBoundingClientRect()
```
**注意**
- 支付宝小程序:其逻辑与微信小程序不同,它提供了菜单点击后按钮的自定义功能,可以选择显示那些系统按钮,[规范详情](https://docs.alipay.com/mini/api/optionmenuitem)
#### nextTick(function callback)
在小程序自定义组件,如wxcomponents中使用。延迟一部分操作到下一个时间片再执行。(类似于 setTimeout) 。其他平台无此概念。
- 微信小程序:[规范详情](https://developers.weixin.qq.com/miniprogram/dev/api/wx.nextTick.html)
- 百度小程序:[规范详情](https://smartprogram.baidu.com/docs/develop/api/custom_component/#swan-nextTick/)
- QQ小程序:[规范详情](https://q.qq.com/wiki/develop/miniprogram/API/interface/interface_nexttick.html#qq-nexttick)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册