繁体   English   中英

使用Phonegap的IBM Worklight响应式Web App

[英]IBM Worklight Responsive Web App using Phonegap

我正在尝试使用Phonegap(cordova)和IBM Worklight创建一个示例混合移动应用程序。 我已将iPad和iPhone添加为目标设备。

应用内的Web内容将使用CSS @media查询来响应。

我面临的问题是,当我在iPad / iPhone上启动该应用程序时,它无法识别我编写的媒体查询。 我尝试使用设备方向方法和最大宽度方法来切换CSS。 仍然没有成功。

设备宽度方法中使用的代码是

/* Portrait */
@media screen and (max-width: 768px) {
  /* Portrait styles since iPad in portrait has device width 768px */

/* Landscape */
@media screen and (max-width: 1024px) {
    /* Landscape styles since iPad in landscape has device width 1024px  */
}

为了定位,我尝试了

/* Portrait */
@media screen and (orientation:portrait) {
  /* Portrait styles */

/* Landscape */
@media screen and (orientation:landscape) {
    /* Landscape styles */
}

任何人都可以建议如何在IBM Worklight中创建响应式Webapp,phonegap

尝试这个:

/* iPhone (landscape) */
@media only screen and (min-width : 321px) {
    /* Your style here */
}

/* iPhone (portrait) */
@media only screen and (max-width : 320px) {
    /* Your style here */
}

/* iPad (landscape) */
@media only screen  and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : landscape) {
    /* Your style here */
}

/* iPad (portrait) */
@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait) {
    /* Your style here */
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM