iPhone 4 Tab Bar Icons - iphone

I'm having some issues getting high resolution tab bar icons displaying correctly for iPhone 4. Basically I'm using the Apple guidelines of 96 x 64 for high resolution icons, but when I do this, my icon looks like it is being scaled many times in the tab bar icon area and only part of the icon appears. If I set the icon size to 30 x 30, the icon displays correctly in terms of proportions but is not sharp because of the higher resolution of the iPhone 4 display.
I've tried other sizes like 64x64 and 60x60 but I get similar problems.
Any ideas?

you have to add #2x to youre iPhone 4 image..
So if you have a 30x30 image named image.png, make a 60x60 version and name it image#2x.png..

You have to name your icon file with #2x!
But in the attributes inspector you have to fulfill the field "Image" taking off the #2x on the file name:
example:
Original file name:"icone#2x.png"
Image field: "icone.png"

Related

Managing iPhone 5 and iPhone 6 image sizes

I am new to programming and Xcode and struggling with setting image size for iPhone 5 and iPhone 6. Apparently both iPhone 5 and 6 use the #2x image while the 6+ use the #3x image. So i can design the 6+ perfectly, however since both iPhone 5 and 6 use the same image and they have different screen size/ resolution, mu screen design is impacted.
If I design the images as per iPhone 6 size, the images appear too big on iPhone 5 and if I design them as iPhone 5 then they appear to be too small on iPhone 6. This should be simple, what am I missing?
Please help!
Instead of directly using the images you should create an entry for them in the Images.xcassets. Select it in your Project Navigator.
Then drag and drop the #3x or #2x version of your image from the images folder into the list of images in the Images.xcassets window. This will automatically generate a new entry. Then drag the other (#2x or #3x) image into its proper position. It will look like this in the end.
Once that is done you can use it in the UIImageView, or Image for a button or whatever in your Storyboard as just the name without the #2x or #3x.
Now to finally answer your question. You should handle all of the image sizes with constraints in the storyboard. So for instance if you want the same margins on either side of your image you will create constraints between the size of the UIImageView that contains your image and the edge of the Superview. This way the image will be resized for each new screen.
Edited to add Be careful of the Constrain to margins check box as you want to be consistent with using it or not otherwise you will get behavior you didn't plan for. I always uncheck it and have my constraints go to the superview edge, but it doesn't matter as long as you are consistent across your App you won't get confused.

UITabBarItem Image wrong size

I'm using a storyboard with a TabBarViewController. The UIViewController of the tabs are embedded in UINavigationViewController. I'm using .png files and added through the attributes inspector to the view. At the size inspector the Image Inset is set "18" for top, bottom, left & right.
If the apps starts the icons are a lot too small. After tapping a tab it changes the size to the desired size.
How can I get the correct size of the icons without tapping it?
Thanks!
You have to provide your images in 2 resolutions.
If you use xcassets, just drag&drop your images in 1x and in 2x resolution on the placeholders and give it a name.
If you do not use xcassets, provide the 2 files with names:
image.png (normal resolution) and
image#2x.png (for retina)
Within your code just use image.png as filename, XCode automatically picks the correct file.

How to resize Cutom Buttons and Labels according to iphone 4?

I have an application containing number of images, custom buttons having images and number of labels.
My problem is to resize those buttons,images and labels according to iphone 4 as wel as iphone 3.
i know that images named #2x are used for high resolution, but I cant find any way to enlarge my custom buttons and labels and also those images which didn't define in code.
how do I get their exact position??
Although screen resolution of iPhone is 640x960, screen dimensions for UIKit are still 320x480 so normally you don't need to adjust coordinates for your UI elements specifically for iPhone4.
If you have '#2x' images for retina display then system will automatically draw them appropriately in the frame you had for normal display.

iPhone 4 application "icon" appears Blurry and Small

I have created my iPhone .png application 'icon' (57x57 with 72 Resolution), however, when I test on my iPhone 4, the image does not appear to cover the entire icon space (a tad small in height) and is a little blurred when compared to the original. Is this because of the high resolution display offered on the iPhone 4? How should I edit my image, so that the device will display a clear and correctly sized icon?
Thanks in Advance,
Jeremy
Create a new icon at 114x114. Call it icon#2x.png and add it to your Resources.
This will use the higher resolution icon for Retina displays.
You can see the full list of recommended icon names and sizes here http://developer.apple.com/library/ios/#qa/qa1686/_index.html
Indeed, you'll have to double the amount of pixels you have: create a 114x114 image and name it Icon#2x.png.
You should have a high quality icon (512x512) already if you plan to release your app on the app store, reducing it's size should work just fine.

Image resolution problem in iPhone 4

I am having a problem in iphone 4. The images used in iPhone less than 4 are fine but when I upgraded to iphone 4 the images looks distorted.
Here is the link.
The image size I have used is 320 x 480.
http://img822.imageshack.us/img822/8431/download22.png
Thanks.
The fact is that the resolution of iPhone4 is 960x640 instead that 480x320 so the image is scaled with linear (or bilinear, not sure) filtering.. the result is what you get: a blurry image.
Just redo the image with the proper resolution to solve the problem, you mainly notice these kinds of artifacts because you have rasterized text on an image..
You obtain this effect whenever you resize an image to fit a wider area of pixels: the missing pixels must be filled somehow and filtering comes into play. So you will have to consider also that part of the screen is used by the top bar to have an exact sized picture.
Create a #2x suffix to each of your png that you use.
example:
Icon.png
Icon#2x.png
The runtime environment will choose the double-resolution on retina display devices.
It looks like your original image is 480x320, but you aren't accounting for the fact that the status bar is compressing your image slightly (or perhaps it does on the iPhone4 but on the older iPhones it is cropping instead).
I'd check the image view settings for that background image.