临时写了一个 没有判断其他刘海屏
let isIphoneX = false
if(cc.sys.os == cc.sys.OS_IOS){
var size = cc.view.getFrameSize();
isIphoneX = (size.width == 414 && size.height == 896)
||(size.width == 375 && size.height == 812);
}
this.binder.topWidget.isAbsoluteTop = false
if(isIphoneX)
{
this.binder.topWidget.top = 0.05
}else
{
this.binder.topWidget.top = 0
}
2赞
