所以我有一个应用程序,我使用手机差距作为包装和专门针对iPad。现在我想要合并一个iPhone版本的应用程序,但有它,所有它在一个应用程序一起编译。所以我想我的问题是,手机差距允许设备特定的布局,让你使用JavaScript来检测这个?
So I have an app I made using phone gap as a wrapper and targeted at specifically iPad. Now I want to incorporate an iPhone version of the app but have it so that its all complied together in one app. So I guess what my question is, does phone gap allow for device specific layouts and let you use JavaScript to detect this?
推荐答案是的,但最快的方法可能是获取设备的屏幕尺寸,并从那里开始:
Yes, but the fastest way is probably to get the screen size of the device and start from there:
var widthScreen = window.innerWidth; var heightScreen = window.innerHeight;根据你得到的大小,你可以放心地假设,如果你正在使用iPads vs. iPhone5 vs 。iPhone4并进行更改。
According to the size you get you can safely assume if you're working on iPads vs. iPhone5 vs. iPhone4 and make your changes.
更多推荐
响应式设计支持手机间隙
发布评论