小程序自定义导航栏

1.导航栏包括状态栏和标题栏两部分,微信小程序自身的导航栏可以直接用;

2.如果需要自定义导航栏 "navigationStyle":"custom",只能用微信提供的 js api 获取,uni.getSystemInfoSync();

3.uni-app 的 css 变量 var(--status-bar-height) 的值错误,不能用;

const sysInfo = uni.getSystemInfoSync();
console.log('状态栏的高度,单位px', sysInfo.statusBarHeight);
console.log('标题栏的高度,单位px', '44px');
console.log('可使用窗口高度,单位px', sysInfo.windowHeight);

 

posted @ 2022-11-25 14:10  heroljy  阅读(219)  评论(0编辑  收藏  举报