摘要: 在開發iOS應用程式時,一個重要的任務是確保應用在不同的屏幕和設備上呈現出良好的用戶體驗。為了實現這一目標,iOS提供了尺寸類別、Auto Layout和Size Classes等強大的工具和技術。 尺寸類別是描述設備屏幕尺寸的屬性,它可以幫助開發者瞭解當前界面所在的設備環境。明確的設備尺寸... ...
表格中包括了各種型號的iPad、iPhone、以及iPod touch等設備的詳細信息,涵蓋了從iPad Pro到各代iPhone和iPod touch的多個型號。
這些信息可用於開發應用程式時優化界面佈局和圖像顯示,確保在不同設備上有良好的顯示效果。
Device screen sizes and orientations
Device |
Dimensions (portrait) |
---|---|
12.9” iPad Pro |
1024x1366 pt (2048x2732 px @2x) |
11” iPad Pro |
834x1194 pt (1668x2388 px @2x) |
10.5” iPad Pro |
834x1194 pt (1668x2388 px @2x) |
9.7” iPad Pro |
768x1024 pt (1536x2048 px @2x) |
8.3” iPad mini |
744x1133 pt (1488x2266 px @2x) |
7.9” iPad mini |
768x1024 pt (1536x2048 px @2x) |
10.9” iPad Air |
820x1180 pt (1640x2360 px @2x) |
10.5” iPad Air |
834x1112 pt (1668x2224 px @2x) |
9.7” iPad Air |
768x1024 pt (1536x2048 px @2x) |
10.2” iPad |
810x1080 pt (1620x2160 px @2x) |
9.7” iPad |
768x1024 pt (1536x2048 px @2x) |
iPhone 15 Pro Max |
430x932 pt (1290x2796 px @3x) |
iPhone 15 Pro |
393x852 pt (1179x2556 px @3x) |
iPhone 15 Plus |
430x932 pt (1290x2796 px @3x) |
iPhone 15 |
393x852 pt (1179x2556 px @3x) |
iPhone 14 Pro Max |
430x932 pt (1290x2796 px @3x) |
iPhone 14 Pro |
393x852 pt (1179x2556 px @3x) |
iPhone 14 Plus |
428x926 pt (1284x2778 px @3x) |
iPhone 14 |
390x844 pt (1170x2532 px @3x) |
iPhone 13 Pro Max |
428x926 pt (1284x2778 px @3x) |
iPhone 13 Pro |
390x844 pt (1170x2532 px @3x) |
iPhone 13 |
390x844 pt (1170x2532 px @3x) |
iPhone 13 mini |
375x812 pt (1125x2436 px @3x) |
iPhone 12 Pro Max |
428x926 pt (1284x2778 px @3x) |
iPhone 12 Pro |
390x844 pt (1170x2532 px @3x) |
iPhone 12 |
390x844 pt (1170x2532 px @3x) |
iPhone 12 mini |
375x812 pt (1125x2436 px @3x) |
iPhone 11 Pro Max |
414x896 pt (1242x2688 px @3x) |
iPhone 11 Pro |
375x812 pt (1125x2436 px @3x) |
iPhone 11 |
414x896 pt (828x1792 px @2x) |
iPhone XS Max |
414x896 pt (1242x2688 px @3x) |
iPhone XS |
375x812 pt (1125x2436 px @3x) |
iPhone XR |
414x896 pt (828x1792 px @2x) |
iPhone X |
375x812 pt (1125x2436 px @3x) |
iPhone 8 Plus |
414x736 pt (1080x1920 px @3x) |
iPhone 8 |
375x667 pt (750x1334 px @2x) |
iPhone 7 Plus |
414x736 pt (1080x1920 px @3x) |
iPhone 7 |
375x667 pt (750x1334 px @2x) |
iPhone 6s Plus |
414x736 pt (1080x1920 px @3x) |
iPhone 6s |
375x667 pt (750x1334 px @2x) |
iPhone 6 Plus |
414x736 pt (1080x1920 px @3x) |
iPhone 6 |
375x667 pt (750x1334 px @2x) |
4.7” iPhone SE |
375x667 pt (750x1334 px @2x) |
4” iPhone SE |
320x568 pt (640x1136 px @2x) |
iPod touch 5th generation and later |
320x568 pt (640x1136 px @2x) |
這個表格列出了不同設備的屏幕尺寸和方向(portrait and landscape,縱向/橫向)以及它們在point(pt)和像素(px)之間的轉換關係。
每個設備都有相應的縱向尺寸和橫向尺寸,在縱向模式下,它們的屏幕解析度是多少。
比如,以iPad Pro系列為例,12.9英寸的iPad Pro在縱向模式下的尺寸為1024x1366 pt,對應的像素為2048x2732 px @2x。這意味著在這種模式下,屏幕上有1024x1366個點,實際顯示時為2048x2732個像素。
Device size classes
尺寸類別屬性是系統提供給開發者的一種指導,用於描述設備屏幕的不同尺寸類別。它們可以幫助開發者更好地瞭解當前界面所在的設備環境,從而做出相應的佈局和設計調整。
“常規寬度,常規高度”和“緊湊寬度,緊湊高度”是用來描述設備屏幕尺寸的不同類別。這些尺寸類別會影響應用程式的佈局和顯示效果,特別是在響應式設計方面。
-
常規寬度,常規高度(Regular width, Regular height):這種尺寸類別適用於較大的屏幕,如iPad等大屏設備,以及iPhone在橫向模式下。在這種情況下,應用程式通常有更多的空間來展示內容,因此可以考慮採用更複雜的佈局和設計。
-
緊湊寬度,緊湊高度(Compact width, Compact height):這種尺寸類別適用於較小的屏幕,如iPhone等小屏設備,以及iPad在豎向模式下。在這種情況下,屏幕空間有限,因此應用程式可能需要採取簡化佈局或調整元素大小以適應較小的屏幕空間。
對於開發者來說,理解不同尺寸類別的差異可以幫助他們更好地設計適配不同設備的界面佈局。通過使用Auto Layout和Size Classes等技術,開發者可以針對不同尺寸類別創建靈活的界面,確保應用程式在各種設備上都能夠呈現出最佳的用戶體驗。
Device |
Portrait orientation |
Landscape orientation |
---|---|---|
12.9” iPad Pro |
Regular width, regular height |
Regular width, regular height |
11” iPad Pro |
Regular width, regular height |
Regular width, regular height |
10.5” iPad Pro |
Regular width, regular height |
Regular width, regular height |
9.7” iPad |
Regular width, regular height |
Regular width, regular height |
7.9” iPad mini |
Regular width, regular height |
Regular width, regular height |
iPhone 15 Pro Max |
Compact width, regular height |
Regular width, compact height |
iPhone 15 Pro |
Compact width, regular height |
Compact width, compact height |
iPhone 15 Plus |
Compact width, regular height |
Regular width, compact height |
iPhone 15 |
Compact width, regular height |
Compact width, compact height |
iPhone 14 Pro Max |
Compact width, regular height |
Regular width, compact height |
iPhone 14 Pro |
Compact width, regular height |
Compact width, compact height |
iPhone 14 Plus |
Compact width, regular height |
Regular width, compact height |
iPhone 14 |
Compact width, regular height |
Compact width, compact height |
iPhone 13 Pro Max |
Compact width, regular height |
Regular width, compact height |
iPhone 13 Pro |
Compact width, regular height |
Compact width, compact height |
iPhone 13 |
Compact width, regular height |
Compact width, compact height |
iPhone 13 mini |
Compact width, regular height |
Compact width, compact height |
iPhone 12 Pro Max |
Compact width, regular height |
Regular width, compact height |
iPhone 12 Pro |
Compact width, regular height |
Compact width, compact height |
iPhone 12 |
Compact width, regular height |
Compact width, compact height |
iPhone 12 mini |
Compact width, regular height |
Compact width, compact height |
iPhone 11 Pro Max |
Compact width, regular height |
Regular width, compact height |
iPhone 11 Pro |
Compact width, regular height |
Compact width, compact height |
iPhone 11 |
Compact width, regular height |
Regular width, compact height |
iPhone XS Max |
Compact width, regular height |
Regular width, compact height |
iPhone XS |
Compact width, regular height |
Compact width, compact height |
iPhone XR |
Compact width, regular height |
Regular width, compact height |
iPhone X |
Compact width, regular height |
Compact width, compact height |
iPhone 8 Plus |
Compact width, regular height |
Regular width, compact height |
iPhone 8 |
Compact width, regular height |
Compact width, compact height |
iPhone 7 Plus |
Compact width, regular height |
Regular width, compact height |
iPhone 7 |
Compact width, regular height |
Compact width, compact height |
iPhone 6s Plus |
Compact width, regular height |
Regular width, compact height |
iPhone 6s |
Compact width, regular height |
Compact width, compact height |
iPhone SE |
Compact width, regular height |
Compact width, compact height |
iPod touch 5th generation and later |
Compact width, regular height |
Compact width, compact height |