响应式设计支持手机间隙 [英] Responsive design support of phone gap

查看:117
本文介绍了响应式设计支持手机间隙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我有一个应用程序,我使用手机差距作为包装和专门针对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.

这篇关于响应式设计支持手机间隙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆