png images does not load with ios 5.1 - ios

I have few png images in my App and and i have placed it in the UIImageView of xib but the problem is the images loads fine with ios 6.0 simulator but the images are not visible in ios 5.1 simulator and my Xcode version is 4.5 same with my devices in ipad 3 it loads fine and ipad 1 it is invisible any problem with image resolutions

Make sure you add it with extension:
UIImage *image = [UIImage imageNamed:#"image.png"];

Related

Image in Storyboard LaunchScreen isn't retina

I'm creating a launchscreen with Storyboard, and am using a UIImageView. I specify the image named, and when my app opens, the launch screen shows a blurry version of my image (it's not using to 2x version of the image).
I later programmatically show the same image using [UIImage imageWithName:#"name"], and it shows retina as expected.
The image is saved in an Image Assets file, and I specify the #1x, #2x, and #3x versions.
Any ideas?

Do I have to have LaunchScreen.xib for iOS 8 launch images?

I'm using Xcode 6.1.
In Launch Image sources = LaunchImage and in Launch Screen File = Main_iPhone. In Images.xcassets under Launch Image Name = LaunchImage.
I currently have a Retina HD 5.5 and Retina HD4.7 Launch Image in appropriate sizes for iOS 8. Yet for all iOS 8 devices whether on iPhone 4s, iPhone5's, or iPhone 6's, iOS 8 doesn't load Launch Image. I don't use xib, only storyboards. However, do I have to create an xib file called LaunchScreen.xib and put my iOS 8 Launch Images in that file for iOS 8 to launch the images?
So i'd put just 2 iOS 8 images in there and xib has no problem with me using storyboards to build game? Is that the only way for a Launch Image to work for iOS 8 in Xcode 6.1?
edit:
So I just made a LaunchScreen.xib file. In that file I put my Retina HD 4.7 inch launch image for the 4.7 inch screen. In Launch Screen File I put as LaunchScreen.xib I still get the same result. iOS 7 launch images load but iOS 8 launch images don't load.
I had the same problem but had marked the xib as a launch screen, but just needed to select it as the launch xib in the build settings, general tab.
Have you marked the view in the xib as "Use as Launch Screen" in the File Inspector?

UIImageView not showing image in Xcode 6.0 iOS 7.1 and Later

The images on UIImageView in my application is showing up in iOS 7.0 and earlier but not on iOS 7.1 and later. I Have used the old naming convention like imageName#2x.png and imageName.png.Also set it in the
Code.But its not working at all.
When I replace the UIImageView with UIButton and set Image on it , it works fine but it would cause a lot of effort for me to change it everywhere in application.
Try with removing .png extensions. If Asset Catalogs are enabled, no need to give image extensions

Custom UIBarButtonItem icon stretched

I've got a retina and non-retina printer icon. When I just specify 'PrinterIcon.png' on,
[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:#"PrinterIcon.png"] style:UIBarButtonItemStyleBordered target:self action:#selector(printCmdTouched:)];
it just using the non retina image on my iPad 3 (third generation). If I specifically specify 'PrinterIcon#2x.png' (x lower cased) I don't see it in the toolbar. If I specify 'PrinterIcon#2X.png' it does show in the toolbar but is stretched horizontally.
Anyway know why?
The retina image specs are:
Image Size:40x40
Image DPI: 299.99 pixels/inch
Color Model:RGB
The non-retina image specs are:
Image Size:20x20
Image DPI:72.00 pixels/inch
Color Model:RGB
I checked the specs in Pixelmator.
Attached are the images.
Anyone know why this is not working?
I'm using iOS SDK 5.1
iOS Deployment Target 5.0
Base SDK: Latest iOS (iOS 5.1)
I fixe the issue. I cleaned the build and removed the app from the device before debugging again. Now all good.

Retina iOS device does not show the #2X image, it shows the 1X image

Retina iOS device does not show the #2X image, it shows the 1X image.
I'm using Xcode 4.2.1 Build 4D502, the app is targeting iOS 5.
I've created a test app (Master/Detail) and added two images.
iconTest.png 24 x 24
iconTest#2X.png 48 x 48
Each image is unique so it I can easily tell which one is being displayed.
In the ViewDidLoad I'm adding a button to the navigation controller...
UIImage *buttonImage = [UIImage imageNamed:#"iconTest.png"];
UIBarButtonItem *button = [[UIBarButtonItem alloc]
initWithImage:buttonImage
style:UIBarButtonItemStyleBordered
target:self
action:#selector(share)];
self.navigationItem.rightBarButtonItem = button;
When I run this test app in the iOS Simulator it correctly displays the icon for a retina iOS device. In the simulator, the Hardware->Device-> is set to iPhone (Retina). And when I pause the app and look at the buttonImage object I can see the scale is set to 2.
This works as expected!
However, when I attach my iPhone 4 and run the app the lower resolution image shows up.
And, when I pause the app and look at the buttonImage object I can see the scale is 1.
This is not the expected behavior.
Any ideas about why this is different between the simulator and the real iOS device?
Is this a known issue? Is there a known workaround?
Thanks,
Brian.
Filenames are case sensitive on the iPhone but not on the iPhone Simulator. You need to use #2x instead of #2X.

Resources