(工作)@media查询iPhone 6(phonegap)?

问题描述:

我试图通过扩展我的CSS文件为iPhone 6和iPhone 6 Plus来更新Phonegap(3.4.0)应用程序,但是,媒体查询似乎不能正常工作(仅在目前为止的模拟器测试中,8.0/550.1)。特别是,使用resolution,device-width,max-device-width等的任何测试似乎都失败了。我试图通过逐一测试条件来弄清楚发生了什么。任何测试device-aspect ratioresolution在iPhone 6上都失败了。对于device-widthdevice-height,我尝试了实际像素值(1334px,750px)以及虚拟尺寸(667px,375px)。 device-height似乎工作,device-width不(应用程序是在肖像模式):(工作)@media查询iPhone 6(phonegap)?

@media screen 
and (-webkit-min-device-pixel-ratio: 2) /* this one works */ 
and (resolution: 326dpi) /* fails */ 
and (min-device-width: 375px) /* fails, passes up to 320px ?!? */ 
and (device-aspect-ratio: 16/9) /* fails, so does 9/16 ..? */ 
and (min-device-height: 375px) /* works, but height only */ 
and (max-device-height: 667px) /* works, but height only */ 
{ 
... 
} 

不知道这是一个的Webkit/phongap或iOS8上的问题(如果我忽略了的东西)。有人找出/有(工作)iPhone 6的查询?谢谢

您的应用程序是否具有iPhone 6分辨率的正确闪屏图像?如果没有,该设备报告一个较小的屏幕尺寸(即它最终只是缩放您的应用程序,以适应)

+0

谢谢,我没有意识到启动图像和(报告)屏幕分辨率之间的链接。创建新的资产目录后,它现在可以工作:-) – Pablo 2014-09-20 07:13:15