lingxiaoyi / navigation-bar

微信小程序自定义导航栏组件,navigation,完美适配全部手机
MIT License
763 stars 140 forks source link

魅族 M3 的手机样式乱了,bar 高度对不上 #16

Open yxhlance opened 4 years ago

yxhlance commented 4 years ago

9800580

lingxiaoyi commented 4 years ago

你使用最新的代码测试的吗?最近一版我又最了多个容错处理

yxhlance commented 4 years ago

TIM截图20191119115934 我这个是昨天下载的

lingxiaoyi commented 4 years ago

那不至于啊 你调试一下你那里获取的胶囊信息,发这里我看一下?

yxhlance commented 4 years ago

TIM截图20191119133945 你看看

lingxiaoyi commented 4 years ago

//取值为0的情况 if (!rect.width) { throw 'getMenuButtonBoundingClientRect error'; } 上方这段代码改成下边这样试试 if (!rect.width || !rect.top || !rect.left) { throw 'getMenuButtonBoundingClientRect error'; } 没想到这款机子胶囊信息这么奇葩

lingxiaoyi commented 4 years ago

if (!rect.width || !rect.top || !rect.left || !rect.height) { throw 'getMenuButtonBoundingClientRect error'; } 把高度的判断也加进去

yxhlance commented 4 years ago

可以呀! 好厉害。 最后就是下面这个内容的高度问题了,你现在的效果是滚动的区域也包括了上面的导航,所以会被挡住部分内容,如果是动态计算下面内容的高度就不会。 TIM截图20191119135946

lingxiaoyi commented 4 years ago

导航条默认会有一个占位高度的,你这个我不知道什么情况导致默认高度没了,你测下其他手机.是不是这个手机的问题

yxhlance commented 4 years ago

好像不仅是手机,开发工具也会 TIM截图20191120105620

lingxiaoyi commented 4 years ago

image 我这里没问题啊,你先查查什么问题导致的