uniapp常见兼容问题
解决⽅案:a、使⽤点九图;b、使⽤纯背景(拉伸不影响);c、不使⽤背景图
2、uniapp内嵌h5页⾯,⾃定义title在刘海屏上被遮挡
电动车贴花// 市⾯上已知的刘海屏机型(不全)
fringeScreenModels: [电加热棒
"iPhone X", "iPhone x", "vivo X21A", "ASUS Zenfone 5",
"Ulefone T2 Pro", "Leagoo S9", "HUAWEI P20", "DooGee V",
"OPPO R15", "LG G7", "SAMSUNG S9", "COR-AL00",
"vivo Y83A", "LLD-AL20", "vivo Z1", "PACM00", "PAAM00"],
/
/是否有刘海屏
// 刘海⼿机⾥iphoneX系列刘海⾼度最⾼:60px,以最⼤值适配,若判断为刘海屏UI⾼度统⼀下调60px
hasScreenFringe: function () {
if (!this.systemInfo) {
this.systemInfo = wx.getSystemInfoSync();
}
if (del != null) {
for (let i in this.fringeScreenModels) {
if (del.indexOf(this.fringeScreenModels[i]) > -1) {
开关电源模块并联供电系统
// 是已知机型⾥的刘海⼿机
return true;
}
}
}影像处理
// 屏幕宽⾼⽐⼤于2,基本上90%的⼿机可以确定是刘海屏,就算个别⼿机不是也按刘海屏处理
if (this.systemInfo.windowHeight >= 800 || this.systemInfo.windowHeight / this.systemInfo.windowWidth > 2) { return true;微波
感应开关
}
// // 横屏游戏判断:标定板
// if (this.systemInfo.windowWidth >= 800 || this.systemInfo.windowWidth / this.systemInfo.windowHeight > 2) { // return true;
// }
return false;
},