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

微信小程序 状态栏高度--status-bar-height 不生效

分类:HBuilderX

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

2025-03-08 16:06 负责人:无 分享
已邀请:
jgj_app

jgj_app (作者)

ios 15位置显示不正确,导致返回箭头点击不动,安卓手机正常

  • 恭喜n发财

    .publicBottom {

    padding-bottom: constant(safe-area-inset-bottom);

    padding-bottom: env(safe-area-inset-bottom);

    }

    2025-03-10 14:27

套马杆的套子

套马杆的套子 - 没有解决不了的问题,只有解决不完的问题

你可以这样试试
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;  
    }
DCloud_heavensoft

DCloud_heavensoft

这个css变量取自 getSystemInfo,getSystemInfo 里的状态栏高度正常吗?

  • jgj_app (作者)

    我一个小程序uni.getSystemInfoSync().statusBarHeight 正常,一个使用--status-bar-height 不正常

    2025-03-27 17:37

要回复问题请先登录注册