iOS navigation bar item image size - ios

I want to customize my NavigationBar button and using my own images.
The question is what the size should be?
I found that the button size should be 40*40, so the image should be 80*80 for retina?

These are the sizes that the documentation recommends for custom icons now.
#2: 50 x 50
#3: 75 x 75
Create two images of the above pixel sizes and then add them to a new image set in your Assets.xcassets file. (Apparently the #1 size is no longer needed.)
Alternatively, you could use a universal vector image (pdf) (see here and here). This has been my preference recently.
Related answer
iOS how to set app icon and launch images

Apple updated their Human Interface Guidelines Docs. Now the recommended sizes for creating custom icons for Navigation Bar and Toolbar
#2x - 48px × 48px (24pt × 24pt #2x)
#3x - 72px × 72px (24pt × 24pt #3x)

The typical standard sizes (non-Retina) are 22px by 22px, while the 2x (or Retina) sizes are 44px by 44px.

You should prepare 3 images icons for each tab bar item (1x, 2x and 3x).
First create the 3x at 75w 75h pixels (maximum: 144 x 96) and save it as iconTab0#3x.png.
Then resize it to 50w 50h pixels (maximum: 96 x 64) and save it as iconTab0#2x.png.
Finally resize it to 25w 25h pixels (maximum: 48 x 32) and save it as iconTab0.png.
Now all you need is to select those 3 images at your finder and drag them to your image assets.
human interface guidelines

Apple docs were updated and now the recommended size is 25pt x 25pt.
Please refer to documentation here.

Here are the current sizes:
https://developer.apple.com/design/human-interface-guidelines/ios/icons-and-images/custom-icons/
"Toolbar and navigation bar - between 24x24 (#1x) and 28x28 (#1x)".

Related

iOS: How to set the proper image scale for a bar button item

I'm trying to add my own image as a bar button item, but I don't know how to get the image to scale properly. Apple's Human Interface guidelines recommends that my image be 44x44 px, but when I use a 44x44 px image, it is too large for the toolbar, as you can see:
When I use a smaller version of the image, it looks pixellated on the Retina display. What am I supposed to do here?
In images.xcassets, you can add the images as 1x, 2x and 3x. Xcode will use the appropriate image size depending on the device.
You need to follow apple guidelines for designing you can find it from this link https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/LayoutandAppearance.html#//apple_ref/doc/uid/TP40006556-CH54-SW1
You can find the attached screenshot image for correct sizing for the UIBarButtonItem image size as par the apple guidelines you have to use 44X44 for ratina (#2x) and 22X22 for normal (#1x) for UIBarButtonItem
width 22 pixels X height 22 pixels - ideal for left or right BarButtonItem.
You can resize any image to custom sizes using online tools, one such I used is
http://www.picresize.com/

What can possible cause image look ugly in tab bar iOS?

I have 2 images.
The first one (#2x: 50x50, 72 pixels/ inches) is like this:
It look so ugly in Tab Bar:
The second one (#2x: 48x42, 72 pixels/inches) is like this:
Even it is smaller, it look good in Tab Bar:
I cannot see the different between the 2 images. Can you see and tell me why? I'm new in designing images for iphone. How can I design good image for tab bar? Here you can download the images.
Now you can set that image size according to the devices you are using
Tab bar icon (optional)
iPhone 6 Plus (#3x)
About 75 x 75 (maximum: 144 x 96)
iPhone 6 and iPhone 5
(#2x) About 50 x 50 (maximum: 96 x 64)
iPhone 4s (#2x)
About 50 x 50 (maximum: 96 x 64)
iPad and iPad mini (#2x)
About 50 x 50 (maximum: 96 x 64)
iPad 2 and iPad mini (#1x)
About 25 x 25 (maximum: 48 x 32)
According to the screenshot, I am suspecting image size.
I can't tell the exact reason why because never seen document regarding that found yet.
But in the practical experience those somewhat "distort" border problem happens when the image size and the control size are different even it has 1 pixel differences.
For example,
My UIImageView size is 32x 50, and my #2x image file for that imageView is 64 x 101. This can be cases because when we slice down, original image can have this pixel differences and we keep it for aspect ratio.
In this case, the size can be said 32 x 50.5 which is actually a bit difference and then, the image is showing "distort" or "blur" at it's border
Solution is just change it's image size as required.
After hours of researching finally I found out the reason. It's so silly of myself but I have to post this with hope that it will save time for other iOS developers who also want to design their own app:
Basically when exporting images to be used inside your app, your need to export with with PNG-24 type. That's all. (See image below as an example).

UIBarButtonItem image appears pixelated

In my IOS app, I'm trying to incorporate images on UIBarButtonItems. I found some icons on IconFinder, but they appear pixelated when I specify the image using the Storyboard (I exported 22x22 pixel pngs).
It appears fine in the storyboard but pixelated on my device / in the simulator:
How can you ensure that UIBarButtonItem images are not pixelated? I've read that they should be 22x22.
They should be 22 x 22 points. You are dealing with pixels.
You need an #2x image that is 44 x 44 as well as an #3x image that's 66 x 66 if you're optimizing for iPhone 6 Plus.
Here's a helpful link about the difference between points and pixels

How to Sharpen Images for iPhone Usage

I have some images that i want to use on my iphone application. The problem is i think that the resolution is not right cause its not sharp at all when see it on the device. This is how it looks when i zoom in a bit on it:
The idea is to use this image as an image for a UITabBarItem.
Any help and general advice on how to make it sharper & better etc.. or how to make images for iPhone devices and make #2x, #3x etc??
Thank you
The tab bar icon size will be displayed about 25 x 25 point. (maximum: 48 x 32)
What does it mean?
Assume, you would like to use an watch.pngas the tabBar icon.
So you need three icon to achieve it:
watch.png -> 25 x 25 pixel (for iPhone without retina display)
watch#2x.png -> 50 x 50 pixel ((maximum: 96 x 64 - for iPhone 6, 5, 5s)
watch#3x.png -> 75 x 75 pixel (maximum: 144 x 96 - for iPhone 6 Plus)
For more details see [Human Interface Design]
Of course, you need a vector graphic image to achieve it and export it in the 3 size. A designer should know the details.
Or you can buy some icons (/download some free icons) in your topic. Several flat icon set are available, e.g.:
www.flaticon.com
http://www.pixeden.com/free-icons-set

Supporting #3x, #2x Tab bar icons with PaintCode 2 StyleKit

I followed the PaintCode tutorials on StyleKit and I've successfully exported icons into a Swift project (code only - MyStyleKit.swift file). I'm trying to understand the relationship between the UIImage generated in code and the image sizes expected for different iOS devices.
I wired up the MyStyleKit object in the storyboards to the image for the Tab bar icon. Works great but I can't tell if the resolution of the image is adjusting depending on the device. Apple's HIG suggests the tab bar icon size in pixels should be
75 x 75 px for #3x images (iphone6+)
50 x 50 px for #2x retina image
25 x 25 px for non-retina
Firstly what canvas size should I be choosing in PaintCode initially? I guessed at putting the canvas size as 25 x 25, reasoning that I should map to the UI points size.
When I rig up the icon in Storyboards does it automatically adjust to whether it needs #3x, #2x or #1x?
Should I be setting the canvas size to the UI points size?
Any help would be greatly appreciated.
Yes, set the canvas size to 25×25 points. You can then preview the canvas at #1x, #2x or #3x (or infinite) scale.
When you ask the StyleKit for image of this canvas, the returned UIImage will have the size of 25×25 points, but scale of the current screen. That means 25×25, 50×50 or 75×75 pixels.

Resources