小程序中下方的导航会被iPhone X下面的那条黑线盖住【微笑脸】,所以要专门为了iPhone X做样式上的适配【微笑脸】
wx.getSystemInfo({
success: function (res) {
//console.log(res.model)
//console.log(res.language)//zh_CN(en)
//console.log(res.model=="iPhone X")
if (res.model=="iPhone X") {
that.globalData.isIPX = 1;
}
}
})
但是呢,好在官方文档里有给出API可以获取到设备的信息,判断之后去给class添加样式就可以啦
class="{{isIPX?'isIPX':''}}"
.isIPX {
bottom: 68rpx !important;
}
关于这个68rpx,贴上解释链接(哈哈这个方法就是在这里学到的略略略)http://www.jb51.net/article/129396.htm点击打开链接