Set the color of the bottom border of the navigation bar

更新时间:
复制 MD 格式

This API sets the color of the bottom border of the navigation bar. To hide the border, you can set its color to match the color of the navigation bar.

How to Use the setBarBottomLineColor Interface

AlipayJSBridge.call("setBarBottomLineColor", {
  color: 16711688
});

Code example

<div style="padding-top:80px;">
  <a href="javascript:void(0)" class="btn title">Set navigation bar border color</a><br>
</div>

<script>
function ready(callback) {
  // If jsbridge is already injected, call the callback directly.
  if (window.AlipayJSBridge) {
    callback && callback();
  } else {
    // If jsbridge is not injected, listen for the AlipayJSBridgeReady event.
    document.addEventListener('AlipayJSBridgeReady', callback, false);
  }
}
ready(function(){
  document.querySelector('.title').addEventListener('click', function() {
    AlipayJSBridge.call("setBarBottomLineColor", {
      color: parseInt('ff0000', 16)
    });
  }, false);
},false);
</script>

API description

AlipayJSBridge.call('setBarBottomLineColor',{
  color
}, fn)

Input parameters

Property

Type

Description

Required

Default value

color

int

A decimal color value.

Y

-