實驗 Xcode image view圖片在 1x, 2x, 3x 造成不同的效果。

在Xcode要插入圖片時會有1x,2x,3x等選項,1x 2x 3x的區別在於:

1x: Non-Retina
2x: Retina
3x: Retina HD

此舉措為APP會選擇在不同像素解析度的iPhone(Non-Retina,Retina,or Retina HD)選擇相對應的圖片,因此不會發生圖片失真的狀況。

Step 1:在1x,2x,3x插入不同的相片。

Step 2:插入image View,此時選擇的機種為iPhone 7 Plus

因為iPhone 7 Plus 為Retina HD,跳出的圖片為3x。

Step 3:變更機種成iPhone SE, iPhone 4s看看有什麼反應。

iPhone SE:

iPhone 4s:

此二機種為Retina,圖片就變成2x惹,Xcode好棒棒。

Remark:

插入圖片若有旋轉90度的狀況發生,可參考以下網站說明。

此網站可讀取照片的Exif等資訊,好用。

http://exif.regex.info/exif.cgi

Photo Model:歐巴

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade