hishion

Results 12 comments of hishion

应该是ios第一次渲染拿不到高度值

是的,绝大部分手机都是正常的。不过手机那么多,难保出厂时没有一些问题,可以忽略。 昨天在客户的iPhone XS Max重现出来了,导航栏紧接着就是一个绝对定位的背景图,因为需要覆盖导航栏。 ```html ``` ```javascript data = { navbarTop: '64px' } onShow() { let t = wx.getStorageSync('systemInfo') if (t) { this.navbarTop = (t.screenTop || t.navbarTop) + 4 +...

> 好的。用this.selectComponent 解决了 有简单示例参考下吗?

wepy没有this.selectComponent或者是我不会用,直接修改组件了。 ![code](https://user-images.githubusercontent.com/16042305/67998932-2b66e100-fc95-11e9-87af-455867006234.png)

组件建议用cover-view,避免一些原生组件因为层级引起的问题

查看了自定义导航栏对微信的版本有要求,如果用户的微信版本低于7.0.0,是会有问题的。 ![image](https://user-images.githubusercontent.com/16042305/69208181-9bc69b00-0b8d-11ea-9609-587d02e2e366.png) 查看了微信的基础版本数据,还有在微信开发者工具调试,2.4.2版本导航栏被顶下来了。 ![image](https://user-images.githubusercontent.com/16042305/69208349-3c1cbf80-0b8e-11ea-87d2-c579403fa874.png) 2.4.3才正常 ![image](https://user-images.githubusercontent.com/16042305/69208369-548cda00-0b8e-11ea-8c3b-ea13aa00f62f.png) ![image](https://user-images.githubusercontent.com/16042305/69208154-85b8da80-0b8d-11ea-95f7-570eff513ab4.png)

我一开始的想法是隐藏自定义导航栏,然后显示自带的。以下是采取隐藏的做法: ```javascript getSystemInfo() { // other code let systemInfo = wx.getSystemInfoSync() let sdkVer = systemInfo.SDKVersion this.setData({ supportVersion: this.compareVersion(sdkVer, '2.4.2') > 0 }) }, compareVersion: function (v1, v2) { v1 =...

**初衷是因为看到小程序用户的微信版本有的甚至还在6.6.3** ![image](https://user-images.githubusercontent.com/16042305/69214535-2ca77180-0ba2-11ea-98b4-0b2f2b9fbfae.png)

因为有极少数用户,简单支持下就行了,保证不会同时出现两个导航栏,用display隐藏就是了。反正不支持的情况,微信自己会显示导航栏,主要就是判断不支持情况隐藏自定义导航栏。