Mini Program customizes the style of the top navigation bar

Custom navigation bar:

app.json:
    "navigationStyle": "custom"
:
    
<!--wxml-->
<view class="header">
  <view class="flex">
    
  </view>
</view>
<!--wxss-->
.header{
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 114rpx;
  padding: 0;
  padding-top: 40rpx;
  border-bottom: none;
  background-color: -sharpffffff;
}
.header::after{
  content: "";
  display: inline-block;
  width: 100%;
  height: 40rpx;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  margin: auto;
  background-color: -sharp000000;
}
.header>view{
  width: 100%;
  height: 100%;
  padding: 0 15rpx;
}

Custom effect figure 1 (iphone6):
clipboard.png

iphone5:

clipboard.png

:
clipboard.png
the capsule on the right is always running around compared to the custom navigation bar, how to avoid it?

May.22,2021

found a solution: the door of truth

Thank you for your elders

Menu