tencent cloud

Background
Last updated: 2025-04-03 17:53:13
Background
Last updated: 2025-04-03 17:53:13

setBackgroundColor

This API is used via wx.setBackgroundColor(Object object).
Feature Description: Dynamically sets the background color of the window. Please add "enablePullDownRefresh":true to the page configuration file for testing.
Parameter and Description: Object.
Attribute
Type
Default value
Required
Note
backgroundColor
string
-
No
Background color value, which must be a hexadecimal color value.
backgroundColorTop
string
-
No
Background color of the top window, which must be a hexadecimal color value. This feature is supported only on iOS.
backgroundColorBottom
string
-
No
Background color of the bottom window, which must be a hexadecimal color value. This feature is supported only on iOS.
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
Sample Code
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

This API is used via wx.setBackgroundTextStyle(Object object).
Feature Description: Dynamically sets the style of the dropdown background font and loading image. Please add "enablePullDownRefresh":true to the page configuration file for testing.
Parameter and Description: Object
Attribute
Type
Default value
Required
Note
textStyle
string
-
Yes
The style of the dropdown background text and loading image.
success
function
-
No
Callback Function of Successful Interface Call
fail
function
-
No
Callback Function of Failing Interface Call
complete
function
-
No
Callback function executed upon the completion of the interface invocation (both successful and unsuccessful invocations)
Valid values of object.textStyle
Value
Note
dark
Dark mode
light
Light mode
Sample Code
wx.setBackgroundTextStyle({
textStyle: 'dark' // The dropdown background text and loading icon styles are set to dark.
})

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback