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.
imageStringNoPicture link address, must be https. Use 3x high-definition pictures. If the image is set, the title parameter is inactive.
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.
resetBooleanNoWhether the navigation bar is reset to the default color, false 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).