When adding images to an iOS project, what size should the 1x image be?
For example:
If I have 2 UIImageView
with the same image with a size of 50x50pt and 30x30pt. Can I make one image asset for the both (and which size should this be) or should I make 2 assets ie. image30x30.png and image50x50.png?
This of course extends to images that have a dynamic size (for example 50% of the screen width), which size should they be?
You have 2 options:
您必须为UIImageView
使用2个不同的图像资源。
When you want to resize an image you must remember 2 things:
So, according to your (50x50pt and 30x30pt)images size the best option is to maintain 1 image and it size must be 50x50pt
i) resize this image smaller into 30x30pt
ii) you should not consider image ratio as both image maintain same ratio.(50/50=1 and 30/30 =1)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.