my.setNavigationBar

Set the navigation bar text and style.

Sample Code

copy
my.setNavigationBar({
  title: 'hello',
  backgroundColor: '#108ee9',
  success() {
    my.alert({
      content: 'Success', 
    });
  },
  fail() {
    my.alert({
      content: 'Failed',
    });
  },
});

Parameters

PropertyType

Required

Description
titleStringNoNavigation bar title.
imageStringNo

Picture link address, must be https. Use 3x high-definition pictures. If the image is set, the title parameter is inactive. Currently, SVG images are not supported.

backgroundColorStringNoNavigation bar background color, supporting hex color value.
borderBottomColorStringNo Navigation bar bottom border color, supporting hex color value If the backgroundColor is set, the borderBottomColor does not take effect. The backgroundColor is used by default.
successFunctionNoCallback function upon call success.
failFunctionNoCallback function upon call failure.
completeFunctionNoCallback function upon call completion (to be executed upon either call success or failure).