I am creating a Cocoa app, and when I import #2x images into my project, no image shows up in the app at all. I am using a non-Retina MacBook Pro.
If I have an image, such as image.png, it shows up correctly.
When I import image#2x.png into the project, no image shows when the app is run (even the normal image).
When I change image#2x.png to image#2xx.png (or some other name), the image shows up again. However, now I can't show the image on a Retina device.
Am I not handling Retina images correctly?
You need to include the image.png AND the image#2x.png in your project. Also make sure that when you load the files you do not include the .png extension.
Related
When I try to publish my app to the app store, it shows me two errors:
First: Missing required icon, the bundle does not contain an app icon for iphone/ipod of exactly 57x57 in png format for iOS version <7
Second: Your binary is not optimized for iphone5 - new iPhone apps and app updates submitted must support the 4 inch display on iPhone 5
Does my icon need to be 57x57 or can I use any size and the system will resize it for me?
thanks.
Yes, you need a 57x57 png in your build. I would recommend reading the iOS Human Interface Guidelines: App Icons material.
When u publishing an app icon you shouldn't use transparency it is forbidden apple does it for u automatically.
When you changed png to jpg the background became white , and solved your problem retroactively:-)
I actually found a solution for that.
Whenever you added icon to the image asset, but it's not showing after you archive the app, its because xcode requires jpg image, if you only change the extension .png to .jpg, it won't work.
Took me awhile to found out.
I created an installer for Mac OS X and I noticed all the images being used (in banners and such) are blurry on retina display Macs.
AFAIK when building a retina display app, you provide two images (one normal def, and one high def) and OS X uses the right one.
I tried using the high resolution image but it pushed all of my content to the side.
Are retina displays supported by install4j? I know they are supported for launcher icons, but how do I configure high resolution assets for my installer pages?
Thank you!
As of install4j 5.1.x, there is no support for high-definition images. In install4j 6 it will be possible to place a file with an additional #2x after the name (e.g. image.png and image#2x.png) into the same directory as the selected image and install4j will pick it up and use it on retina displays.
Ok. So I have iPad app in Xcode 4.2 targeted for iOS 5.1. I provided it with launch images for both landscape and portrait modes and it has some serious trouble with using them properly.
First in landscape mode it shows proper landscape image but rotated by 90 degrees CW and cropped on the right side. Then when it starts to display it properly but does it also in portrait mode (as if it doesn't recognize portrait mode at all anymore).
I've seen some suggestions like providing portrait image with rotated content for landscape mode, etc. but the problem is I can't for the life of me make xCode use both images in right moments.
Is there some voodoo for that? Like setting them in proper order, use plist directly or the slots in GUI, putting them in some special directory or two different directories, I don't know - anything? Fighting xCode over such things will make me puke with blood one day...
Ok, one thing to know is that xCode seems to be very capricious when it comes to updating settings, resources etc. I deleted references to the launch images from the project, cleaned the product in xCode and removed the app from simulator but it still somehow managed to use the launch images even though it didn't show copying the images in build log.
I'm not sure if it took the pictures from derived data or what but I had to delete derived data and remove the images manually from the app bundle in ~/Library/Application\ Support/iPhone\ Simulator/5.1/Applications/ to make it stop. Then I pasted the images manually into the app bundle and now after publishing both images work properly in the simulator ignoring the fact that I didn't set them up at all in xCode!
I'm still not sure how to proceed with the device version - it obviously doesn't have the launch images now...
Apparently xCode doesn't care at all about setting anything about the launch images apart from including properly named images in the project so they get copied to the bundle. As I wrote above you can even inject the images into the app bundle and it still works.
The other side is that once you get the images there it may by hard to get rid of them.
So anyway now I have nothing in my plist about the images, nor anything in the slots in the Target Info and I have four working launch images in my app (both orientations and retina).
Hope it helps someone sometime..
In Xcode, I add both image.png (normal size) and image#2x.png (retina size) for my images as resources. When I build my app and look in the /Contents/Resources/ of the bundle, it shows both an image.png file and an image.tiff file. The TIFF contains both normal and retina representations.
Does image.png need to be included in the final app bundle?
I would think it doesn't since the TIFF file contains the same image (as well as the retina version). It just seems to unnecessarily increase the size of the app bundle. I'm building with the 10.8 SDK for 10.6 or later.
I cleaned my project and rebuilt the app and the PNGs went away. Only TIFFs are left. I suppose I should have tried that earlier, but I'll leave this answer in case it helps anyone else.
Now you have to make sure to reference ".tiff" files in your source code though if you were referencing any PNG files. For example:
// "png" changes to "tiff"
NSString *pathForImage = [[NSBundle mainBundle] pathForResource:#"bg" ofType:#"tiff"];
I would like to update some images (gif) in my application. After replacing the gif files in the folder, I build the application and run it; the images shown in simulator are not updated. I tried to "Clear all target" and then re-built the application; the new images can be shown in the simulator.
Does it mean the images will be successfully updated in the devices which have installed the older version of the application? Should I modify the code?
You would need to "Replace" those image by the same names as in the earlier build.In this way even if your app is in the App Store, after submitting your update with the new images having the same names can be updated easily.
No need to modify your code.