Skip to main content
Version: Next

Taro.setBackgroundTextStyle(option)

Dynamically sets the style of the text and the loading image in the pull-down background.

Reference

Type

(option: Option) => Promise<CallbackResult>

Parameters

Option

PropertyTypeRequiredDescription
textStyle"dark" | "light"YesThe style of the text and the loading image in the pull-down background.

Enum:
- 'dark': In dark style;
- 'light': In light style;
complete(res: CallbackResult) => voidNoThe callback function used when the API call completed (always executed whether the call succeeds or fails)
fail(res: CallbackResult) => voidNoThe callback function for a failed API call
success(res: CallbackResult) => voidNoThe callback function for a successful API call

Sample Code

Taro.setBackgroundTextStyle({
textStyle: 'dark' // Yes | The style of the text and the loading image is dark.
})

API Support

APIWeChat Mini-ProgramH5React Native
Taro.setBackgroundTextStyle✔️✔️ (Only iOS)