ios - @3x 图片,Iphone 8 Plus,Iphone X
问题描述
假设,我在 Xcode 的 Main.storyboard 上选择了“查看为:iPhone 8 Plus”。我们知道这些细节:
Iphone X: 375 x 812 points (@3x) 1125x2436 pixels
Iphone 8 Plus: 414 x 736 points (@3x) 1242 × 2208 pixels
Iphone 8: 375 x 667 points (@2x) 750x1334 pixel
假设我想放置一个 UIImageView (顶栏,标题栏图像),如下所示:
请记住,我选择了“查看方式:iPhone 8 Plus”。所以图像的宽度必须是 414 点。让我们假设图像的高度是 100 点。所以图像大小必须是 1242 x 300 像素。(因为 414points*3=1242px,100points*3=300px)
所以,
@3xBackground.png must be 1242 x 300 pixels.
@2xBackground.png must be 828x200, right? **(this is question 1)**
@1xBackground.png must be 414x100, right? **(this is question 2)**
iPhone X 怎么样?Iphone X 也使用@3xBackground.png 图像,对吗?(这是问题3)
我在 iphone 8 plus 上看到这张图片非常清晰。因为我创建了这个关于 iPhone 9 plus 的图像。但我无法在 iPhone x 中看到如此清晰的图像。因为 iPhone X 的宽度是 375 点(1125 像素),但我的图像宽度是 414 点(1242 像素)对吗?iphone x 和 iphone 8 plus 使用相同的图片:@3xBackground.png。设备尝试将 1242 像素的图像放入 1125 像素的位置。那么这张照片怎么看起来这么锐利呢?
将 1242 像素图像放入 1125 像素位置时,Iphone X 是否会降低图像高度?(这是第 4 题)如果回答是。所以应该没问题。
解决方案
推荐阅读
- javascript - 使用一个标题行数组和表的其余标题值数组操作 JSON 键值
- r - 有效地将日期列的小时更改为另一个数据框列 R 的值
- python - 在 python 中,如何用其组成数据填充条形图中的每个条形?
- php - PHP 语句到 SQL Case 语句
- php - PHP 和 AJAX 将数据更新到数据库
- python - Twitter 不再适用于请求库 python
- git - 我想向 github 添加一个文件,而不必在同一个克隆 repo 中添加其他文件夹
- html - 想要创建一个链接,我可以向人们发送将使用预先编写的消息打开他们的电子邮件应用程序的人(不是我自己的网页或应用程序上的链接)
- php - Codeigniter-4更新查询问题未设置我要设置的字段
- bash - bash:意外标记''git config --global user.name“firstname lastname”''附近的语法错误