ios屏幕尺寸完美的屏幕尺寸体验

iOS 屏幕尺寸一般分为以下几种:iPhone 4/4S:5英寸,640 x 960 像素

iOS 屏幕尺寸一般分为以下几种:iPhone 4/4S:5英寸,640 x 960 像素

iOS 屏幕尺寸一般分为以下几种:

1. iPhone 4/4S:3.5英寸,640 x 960 像素

2. iPhone 5/5S/SE:4英寸,640 x 1136 像素

3. iPhone 6/6s/7/8:4.7英寸,750 x 1334 像素

4. iPhone 6 Plus/6s Plus/7 Plus/8 Plus:5.5英寸,1080 x 1920 像素

5. iPhone X/XS:5.8英寸,1125 x 2436 像素

6. iPhone XR:6.1英寸,828 x 1792 像素

7. iPhone XS Max:6.5英寸,1242 x 2688 像素

以下是 Swift 代码示例:

// 获取屏幕尺寸

let screenSize = UIScreen.main.bounds.size

// 根据屏幕尺寸判断设备

if screenSize == CGSize(width: 640, height: 960) {

// iPhone 4/4S

} else if screenSize == CGSize(width: 640, height: 1136) {

// iPhone 5/5S/SE

} else if screenSize == CGSize(width: 750, height: 1334) {

// iPhone 6/6s/7/8

} else if screenSize == CGSize(width: 1080, height: 1920) {

// iPhone 6 Plus/6s Plus/7 Plus/8 Plus

} else if screenSize == CGSize(width: 1125, height: 2436) {

// iPhone X/XS

} else if screenSize == CGSize(width: 828, height: 1792) {

// iPhone XR

} else if screenSize == CGSize(width: 1242, height: 2688) {

// iPhone XS Max

}

本站系公益性非盈利分享网址,本文来自用户投稿,不代表码文网立场,如若转载,请注明出处

(305)
ios小火箭怎么更新订阅:如何使用iOS小火箭更新订阅
上一篇
tg中文版下载ios:iOS版Telegram中文客户端下载指南
下一篇

相关推荐

发表评论

登录 后才能评论

评论列表(79条)