当前位置: 代码迷 >> 综合 >> 微信小程序判断iphonex xs xr 样式
  详细解决方案

微信小程序判断iphonex xs xr 样式

热度:21   发布时间:2024-01-21 01:16:26.0

js:

const res = wx.getSystemInfoSync();if (res.safeArea.top > 20 && res.model.includes("iPhone")) {//判断是否为iphonex xs xrthis.setData({iphoneS: true,});

html:

<view class="bottom-nav {
   {iphoneS&&'d-iphone'}}">
</view>

wxss:

.d-iphone.bottom-nav{padding-bottom: 30rpx;height: 128rpx;}

  相关解决方案