小抖抖
小抖抖
  • 发布:2023-01-16 00:54
  • 更新:2023-01-16 09:37
  • 阅读:189

没有使用原生导航栏的情况下与系统状态栏重叠

分类:wap2app

没有设置全屏,新建项目都是这样,怎么解决

2023-01-16 00:54 负责人:无 分享
已邀请:
瀚海浪亭

瀚海浪亭 - 百度一下,我告诉你。

获取系统信息,然后取的statusBarHreight做适配呗?

  • 小抖抖 (作者)

    具体怎么操作,我新手

    2023-01-16 18:14

  • 瀚海浪亭

    回复 d***@gmail.com:


    <template>  
    <view>
    <view :style="{height: statusBarHeight + 'px'}"></view>
    ...
    </view>
    </template>

    <script>
    export default {
    data() {
    return {
    statusBarHeight: 0
    }
    },
    onLoad() {
    const systemInfo = uni.getsystemInfoSync()
    this.statusBarHeight = systemInfo.statusBarHeight
    }
    }
    </script>

    2023-01-16 19:19

要回复问题请先登录注册