简体   繁体   中英

iOS - Assets Dimensions

I know this type of questions has been asked many times but am still unable to understand is there a standard way of deciding dimensions. Let's say I have a design of a screen in png. 在此处输入图片说明

Now how do I decide the size of the image view and dimension(1x or 2x or 3x) of any static sample image that I want to set in image view.

Normally when you are developing u get a folder which has all three 
resolutions of the same asset that you when drop in the xcassets, can 
see that 1x 2x and 3x automatically lie themselves in the respective shelf.

1x is for iphone <= 4s
2x normally is for iphone 5,5s,6,6s
3x normally is for 6 plus, ipad etc.

Now how u have to figure out ? For this :

Step 1 : Determine the screen size for which the design has been originally made, you'd be better off if u start with the smallest screen size (its comparatively simpler to scale small to big)

Step 2 : Open the design in mac **preview** app and select and drag any part. It'll show you the dimensions. Divide those by 2 and that's the size of the **uiimageview** you want. For example :

这显示了我图像的边界,所以93 x 34是我的imageview的大小,可以完美地容纳资产

check out this link for good https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/IconMatrix.html

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM