Browse Source

导航栏兼容ios

tags/v1.6.0^2
yufei111 2 years ago
parent
commit
01754b057e
2 changed files with 11 additions and 10 deletions
  1. +8
    -8
      custom-tab-bar/index.wxml
  2. +3
    -2
      custom-tab-bar/index.wxss

+ 8
- 8
custom-tab-bar/index.wxml View File

@@ -1,11 +1,11 @@
<!--miniprogram/custom-tab-bar/index.wxml-->
<cover-view class="tab-bar" style='height:{{isIphoneX?166:120}}rpx;'>
<cover-view class="tab-bar-border"></cover-view>
<cover-view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" data-auth="{{item.auth}}" bindtap="switchTab">
<cover-image
<view class="tab-bar" style='height:{{isIphoneX?166:120}}rpx;'>
<view class="tab-bar-border"></view>
<view wx:for="{{list}}" wx:key="index" class="tab-bar-item" data-path="{{item.pagePath}}" data-index="{{index}}" data-auth="{{item.auth}}" bindtap="switchTab">
<image
class="tab-bar-item-image"
src="{{selected === index ? item.selectedIconPath : item.iconPath}}">
</cover-image>
<cover-view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</cover-view>
</cover-view>
</cover-view>
</image>
<view style="color: {{selected === index ? selectedColor : color}}">{{item.text}}</view>
</view>
</view>

+ 3
- 2
custom-tab-bar/index.wxss View File

@@ -8,7 +8,8 @@
background: white;
display: flex;
flex-direction: row;
padding-bottom: env(safe-area-inset-bottom);
/* padding-bottom: env(safe-area-inset-bottom); */
z-index: 1;
}

.tab-bar-border {
@@ -36,6 +37,6 @@
margin-top: 10rpx;
}

.tab-bar-item cover-view {
.tab-bar-item view {
font-size: 20rpx;
}

Loading…
Cancel
Save