On this page
Background
setBackgroundColor
TIP
The API usage is as follows: wx.setBackgroundColor(Object object)
- Functional description: Dynamically set the background color of the window.
- Parameters and descriptions: Object object
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| backgroundColor | string | - | No | The background color of the window must be a hexadecimal color value |
| backgroundColorTop | string | - | No | The background color of the top window must be a hexadecimal color value, only supported by iOS |
| backgroundColorBottom | string | - | No | The background color of the bottom window must be a hexadecimal color value, only supported by iOS |
| success | Function | - | No | Callback function for successful interface call |
| fail | Function | - | No | Callback function for failed interface call |
| complete | Function | - | No | Callback function for interface call completion (executed regardless of success or failure) |
- Sample code:
js
wx.setBackgroundColor({
backgroundColor: '#ffffff', // The background color of the window is white.
})
wx.setBackgroundColor({
backgroundColorTop: '#ffffff', // The background color of the top window is white.
backgroundColorBottom: '#ffffff', // The background color of the bottom window is white.
})setBackgroundTextStyle
TIP
The API usage is as follows: wx.setBackgroundTextStyle(Object object)
- Functional description: Dynamically set the style of the drop-down background font and loading image.
- Parameters and descriptions: Object object
| Properties | Type | Default value | Required | Description |
|---|---|---|---|---|
| textStyle | string | - | Yes | The style of the drop-down background font and loading image |
| success | Function | - | No | Callback function for successful interface call |
| fail | Function | - | No | Callback function for failed interface call |
| complete | Function | - | No | Callback function for interface call completion (executed regardless of success or failure) |
Legal values
Value Description dark dark style light light style Sample code:
js
wx.setBackgroundTextStyle({
textStyle: 'dark' // The dropdown background text and loading icon styles are set to dark.
})