没有苹果机型测试,所以不太清楚。
apicloud写一个页面,frame打开需要确定初始坐标y,即顶部导航栏header高度和状态栏高度加在一起,普遍认为安卓机型高度为25,测试时发现有35的,有28的,要解决这个问题需要用到
var safeArea = api.safeArea; // JSON对象,如{top:20, left:0, bottom:0, right:0}
top: 安全区域上边缘,对于沉浸式下window中该值通常为状态栏高度,全屏或非沉浸式下为0(iPhone X竖屏时全屏状态下也为44)
left: 安全区域左边缘,通常为0(iPhone X横屏时为44)
bottom: 安全区域下边缘,通常为0(iPhone X竖屏时为34,横屏时为21)
right: 安全区域右边缘,通常为0(iPhone X横屏时为44)
api.openFrame({
name: 'shopmain_frame',
url: './shopmain_frame.html',
rect: {
x: 0,
y: api.safeArea.top + 50,
w: api.winWidth,
h: 'auto'
},
bounces:true
});
api.safeArea.top获取状态栏高度,50为导航栏高度,问题解决。