APICloud 学习笔记
本文发布于 10 年前,部分内容可能已经失去参考价值。
快捷键
真机同步:Ctrl + R
注释/取消注释代码:Ctrl + /
整理代码:Ctrl + Shift + F
判断系统是否为 iOS 7 及以上版本
var iOS7AndLater = api.systemType == 'ios' && parseFloat(api.systemVersion) >= 7; // api.systemVersion 结果类似 4.5.6,parseFloat 后 iOS 为 4, Android 为 4.5
swipedown 和 swipeup 失效原因
api.addEventListener({
name:'swipedown'
},function(ret,err){
//operation
});
api.addEventListener({
name:'swipeup'
},function(ret,err){
//operation
});
有时候在监听 swipedown 和 swipeup 事件时没有进入 callback,原因是打开这个 window 或 frame 时,bounces 是 true 的,只要将 bounces: false 即可。
其它未整理的笔记
api.showProgress();
api.hideProgress();
api.openFrame({
name
url
rect
});
api.openFrameGroup
api.openWin
api.setRefreshHeaderInfo({},function(ret,err){
// coding...
alert("正在用力刷新");
api.refreshHeaderLocalDone();
});
localStorage.setItem("xxx",ret.id);
if(localStorage.getItem("xxx")){ }
可能相关的内容