All Products
Search
Document Center

Set background color

Last Updated: Feb 04, 2021

my.setBackgroundColor

This API is supported in mPaaS 10.1.32 and later versions.

Dynamically set window background color.

Input parameters

Attribute Type Required Description
backgroundColor HexColor Yes Background color of the window.
backgroundColorTop HexColor Yes Background color of the window top, only supported in iOS.
backgroundColorBottom HexColor Yes Background color of the window bottom, only supported in iOS.
success Function No Callback function for successful call.
fail Function No Callback function for failed call.
complete Function No Callback function for ended call (executed regardless of whether the call is successful or failed).

Code sample

  1. /*Set window background color*/
  2. my.setBackgroundColor({
  3. backgroundColor: '#ffffff'
  4. })
  5. /*Set background color of window top and bottom respectively*/
  6. my.setBackgroundColor({
  7. backgroundColorTop: '#ffffff',
  8. backgroundColorBottom: '#ffffff'
  9. })

my.setBackgroundTextStyle

This API is supported in mPaaS 10.1.32 and later versions.

Dynamically set the font of the pull-down background and the style of loading graphics.

Input parameters

Attribute Type Required Description
textStyle String Yes The font of the pull-down background and the style of loading graphics. Only dark and light are supported.
success Function No Callback function for successful call.
fail Function No Callback function for failed call.
complete Function No Callback function for ended call (executed regardless of whether the call is successful or failed).

Code sample

  1. my.setBackgroundTextStyle({
  2. textStyle: 'dark', // Font of the pull-down background and the style of loading graphics are dark.
  3. })