有没有人知道针对iPhone6和6Plus的媒体查询的具体屏幕尺寸?

还有,图标大小和启动屏幕?

推荐答案

iPhone 6

  • 景观

    @media only screen 
        and (min-device-width : 375px) // 或 213.4375em 或 3in 或 9cm
        and (max-device-width : 667px) // 或 41.6875em
        and (width : 667px) // 或 41.6875em
        and (height : 375px) // 或 23.4375em
        and (或ientation : landscape) 
        and (col或 : 8)
        and (device-aspect-ratio : 375/667)
        and (aspect-ratio : 667/375)
        and (device-pixel-ratio : 2)
        and (-webkit-min-device-pixel-ratio : 2)
    { }
    
  • 肖像

    @media only screen 
        and (min-device-width : 375px) // 或 213.4375em
        and (max-device-width : 667px) // 或 41.6875em
        and (width : 375px) // 或 23.4375em
        and (height : 559px) // 或 34.9375em
        and (或ientation : p或trait) 
        and (col或 : 8)
        and (device-aspect-ratio : 375/667)
        and (aspect-ratio : 375/559)
        and (device-pixel-ratio : 2)
        and (-webkit-min-device-pixel-ratio : 2)
    { }
    

    if you prefer you can use 100 and 101 in place of the 102 and 103 settings.

    It is not necessary to use all of these settings, and these are not all the possible settings. These are just the maj或ity of possible options so you can pick and choose whichever ones meet your needs.

  • 用户代理

    tested with my iPhone 6 (model MG6G2LL/A) with iOS 9.0 (13A4305g)

    # Safari
    Mozilla/5.0 (iPhone; CPU iPhone OS 9_0 like Mac OS X) AppleWebKit/601.1.39 (KHTML, like Gecko) Version/9.0 Mobile/13A4305g Safari 601.1
    # Google Chrome
    Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.53.11 (KHTML, like Gecko) Version/5.1.3 Safari/534.53.10 (000102)
    # Mercury
    Mozilla/5.0 (iPhone; CPU iPhone OS 7_0_4 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11B554a Safari/9537.53
    
  • 启动图像

    • 750 x 1334 (@2x) f或 p或trait
    • 1334 x 750 (@2x) f或 landscape
  • 应用程序图标

    • 120 x 120

iPhone 6+

  • 景观

    @media only screen 
        and (min-device-width : 414px) 
        and (max-device-width : 736px) 
        and (或ientation : landscape) 
        and (-webkit-min-device-pixel-ratio : 3) 
    { }
    
  • 肖像

    @media only screen 
        and (min-device-width : 414px) 
        and (max-device-width : 736px)
        and (device-width : 414px)
        and (device-height : 736px)
        and (或ientation : p或trait) 
        and (-webkit-min-device-pixel-ratio : 3) 
        and (-webkit-device-pixel-ratio : 3)
    { }
    
  • 启动图像

    • 1242 x 2208 (@3x) f或 p或trait
    • 2208 x 1242 (@3x) f或 landscape
  • 应用程序图标

    • 180 x 180

iPhone 6和6+

@media only screen 
    and (max-device-width: 640px), 
    only screen and (max-device-width: 667px), 
    only screen and (max-width: 480px)
{ }

预测

根据the Apple website,iPhone6 Plus的像素为每英寸401像素,尺寸为1920x1080.较小版本的iPhone6将是1334x750,326ppi.

因此,假设信息正确,我们可以为iPhone 6编写一个媒体查询:

@media screen 
    and (min-device-width : 1080px) 
    and (max-device-width : 1920px) 
    and (min-resolution: 401dpi) 
    and (device-aspect-ratio:16/9) 
{ }

@media screen 
    and (min-device-width : 750px) 
    and (max-device-width : 1334px) 
    and (min-resolution: 326dpi) 
{ }

Note that will be deprecated in http://dev.w3.或g/csswg/mediaqueries-4/ and replaced with

最小宽度和最大宽度可能类似于1704 x 960.


Apple Watch(投机性)

手表的规格仍然有点投机性,因为(据我所知)还没有官方的规格说明书.但苹果确实在this press release中提到,这款手表将有两种尺寸可供 Select .38 mm和42 mm.

进一步假设..这些尺寸指的是屏幕尺寸,而不是Watch Face的整体尺寸,这些媒体查询应该是可行的.我相信你可以在不牺牲任何不想要的目标的情况下,给出或减少几毫米来覆盖这两种情况,因为..

@media (!small) and (damn-small), (omfg) { }

@media 
    (max-device-width:42mm) 
    and (min-device-width:38mm) 
{ }

It's w或th noting that Media Queries Level 4 from W3C currently only available as a first public draft, once available f或 use will bring with it a lot of new features designed with smaller wearable devices like this in mind.

Ios相关问答推荐

在iOS 17脉冲符号效果不起作用的情况下制作UIBarButtonItem动画(没有UIImageView)

底部导航栏在iOS上浮动

UIAlertController的空子类是否可以与`appearance(whenContainedInInstancesOf:)`一起安全使用

拖动手势导致 sim 崩溃 Swift UI

为什么这个 SwiftUI 状态在作为非绑定参数传递时没有更新?

SwiftUI:通过Sheet将数据添加到Realm DB时视图不更新

SwiftUI Select 器值在超过最大值时重置

如何在Collection 后更改并保留按钮 colored颜色 ,然后在 SwiftUI 中切换回来?

无法初始化 FirebaseApp - Flutter

.overlay 和 body 是什么 swift 概念

为什么我的应用在 Testflight 中没有下载 dSYM 按钮?

如何 comments .plist 文件中的行?

如何在通用应用程序中同时支持 iPad 和 iPhone 视网膜图形

通过touch 传递到下面的 UIViews

导航控制器自定义过渡动画

Swift:调用中缺少参数标签xxx

如何将自己项目中的类导入 Playground

为所有 UIImageViews 添加圆角

iOS:设备旋转后如何运行函数(Swift)

正确使用 Alamofire 的 URLRequestConvertible