Symbian S60与iPhone开发指南
1. Symbian S60开发相关
1.1 crossPlatform代码调整
核心小工具依赖于crossPlatform中间件层来运行。在完成S60移植前,需要确保此代码与WRT兼容。幸运的是,该API与OS X上的非常相似,几乎可以重用整个crossPlatform Mac接口。
平台检测是第一步,WRT代码是检测Mac情况的扩展,代码如下:
if (!!window.widget) {
if (!!widget.getAttention) {
crossPlatform.api = 'opera';
crossPlatform.emptyPref = '';
} else if (!!widget.menu) {
crossPlatform.api = 'windows_mobile';
crossPlatform.emptyPref = null;
} else {
if (!!window.menu) {
crossPlatform.api = 'wrt';
} else {
crossPlatform.api = 'mac';
}
crossPlatform.emptyPref = undefined;
}
}
mac和wrt的区别在于widget.menu对象的存在;WRT有手机软键菜单的接口,而Mac没有。实际上,这是对crossPlatform唯一需要的更改,它使用与OS X相同的e
超级会员免费看
订阅专栏 解锁全文
14

被折叠的 条评论
为什么被折叠?



