ios 15 ,安卓版本正常,navigationStyle设置为custom

- 发布:2025-03-08 16:06
- 更新:2025-03-10 14:13
- 阅读:97

套马杆的套子 - 没有解决不了的问题,只有解决不完的问题
你可以这样试试
customBarH 为uni.getSystemInfo中的statusBarHeight
<view class="status_bar" :style="{height :customBarH +'px'}">
<view class="top_view" :style="{height :customBarH +'px'}"></view>
</view>
.status_bar {
height: var(--status-bar-height);
width: 100%;
background-color: $gst-tabBar-title-background-color;
}
.top_view {
height: var(--status-bar-height);
width: 100%;
position: fixed;
background-color: $gst-tabBar-title-background-color;
top: 0;
z-index: 999;
}

这个css变量取自 getSystemInfo,getSystemInfo 里的状态栏高度正常吗?
-
jgj_app (作者)
我一个小程序uni.getSystemInfoSync().statusBarHeight 正常,一个使用--status-bar-height 不正常
2025-03-27 17:37
恭喜n发财
.publicBottom {
padding-bottom: constant(safe-area-inset-bottom);
padding-bottom: env(safe-area-inset-bottom);
}
2025-03-10 14:27