uniapp 您所在的位置:网站首页 uniapp自定义导航栏 uniapp

uniapp

#uniapp| 来源: 网络整理| 查看: 265

1.在pages.json中设置navigationStyle为custom

{ "path": "pages/views/index", "style": { "navigationBarTitleText": "首页", "navigationStyle": "custom" } },

2.非H5端,手机顶部状态栏区域会被页面内容覆盖。这是因为窗体是沉浸式的原因,即全屏可写内容。uni-app提供了状态栏高度的css变量–status-bar-height,如果需要把状态栏的位置从前景部分让出来,可写一个占位div,高度设为css变量。

自定义导航内容 .status_bar { height: var(--status-bar-height); width: 100%; position: fixed; top: 0; background: #fff; z-index: 998; } .customContent { position: fixed; height: 88rpx; background: #fff; top:var(--status-bar-height); width: 100%; z-index: 998; border-bottom: 2rpx solid #eee; }

更多详见自定义导航栏



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有