I have a universal app and I have made my xibs so they can work with iPhone or iPad. However I am getting memory warnings because the UIImages are big. Is there a way to name my image files so that when running on the iPad it will use the iPad images and when on the iPhone it will use the iPhone ones?
Update:
Well that was easy.
iPhone : image.png
iPhone 4 : image#2x.png
iPad : image~ipad.png
I wonder if this will work if I render the images on device and store them locally?
I hope this might give you some hint
I use images with name button.png and button#2x.png and make a call using
[UIImage imagesNamed:#"button.png"];
This loads the correct image on all device according to the resolution of the device, say iPhone3g, iPhone4 and iPad. As in the update you have taken s separate image for iPad, i really doubt that as simply the same image i.e button.png would work.
Well that was easy.
iPhone : image.png
iPhone 4 : image#2x.png
iPad : image~ipad.png
I wonder if this will work if I render the images on device and store them locally?
Related
I'm currently developing an application for iPhone with iOS7, only.
From what I read, for iPhone with iOS7, there is no support for older devices than iPhone4.
If that's the case, when it comes to images, all I need is retina images (#2x).
Can I submit to the App Store, an app with only retina images, since the app's minimal requirement is retina devices ?
Thank you.
Possible duplicate of Can I dump my non-Retina Images for a iOS7 only app?
Anyway, as long as I know you don't need #2x version of your images as long as you don't support old displays, but remember that your images as to be double width and height, then if you have a 100x100px UIImageView, you need to load a 200x200px image to meet retina resolution.
EDIT: To explain in deep.
Actually, iPad 2 and iPad mini 1st generation run iOS 7 and doesn't have retina display. Anyway using #2x images it is not mandatary. You can just use double size images and set your UIImageViews' contentMode to UIViewContentModeScaleToFill to fit your needs.
PROS -> smaller bundle
CONS -> worst performaces
I started to develop an iPhone app for iOS 7.
Since iOS 7 does not support devices with non-retina display for the iPhone/iPod touch, and it uses high-resolution images on non-retina iPads (iPad 2 and iPad mini) in the iPhone emulation mode, now I think we don't need to provide low-resolution images when developing an iPhone-only app which deployment target is iOS 7.
I thought it's great, but soon I faced a problem when I used a Storyboard; apparently Interface Builder can not display high-resolution images which file names end with #2x.
I feel it's really pity that we have to provide the low-resolution images ONLY for the Interface Builder...
Is there any good workaround for this? Or do we still have to provide low-resolution images if we want to use the Interface Builder?
You are correct that an iOS 7 iPhone-only app is not going to run on any single-resolution devices, so you only need to provide double-resolution images. Do what you have always done in the past: refer to your image as myImage but name the actual image file myImage#2x.png. Even better, use the asset catalog! Place the double-resolution image in the 2x slot and refer to it by the name of that image set. Either way, this will work perfectly both in the storyboard editor and in the running app; in the storyboard editor, the Media Library and things like buttons that have images will display your image's name as myImage.
We're using retina images in our iPhone app (i.e., double the size).
The images render great on an iPhone 4 -- sharp and crisp. However, for the same app, the images look grainy on an iPad when run in "1x" mode (i.e., iPhone app size).
The code is exactly the same for both apps. There is no iPad version. People just download the iPhone version on iPads.
Are we supposed to use different images for the iPad?
Here is the app: http://itunes.apple.com/app/dumpling/id514239919
If you download it on an iPhone and then again on an iPad, you'll see the difference.
If the app is not universal then they are rendering the iPhone version on the iPad. I'm assuming you aren't in "2X" mode so if you are on an iPad 1 or 2 your app would not be using the retina graphics so it'll look grainy. Have you tested this on an iPad 3? This should render correctly for you with the #2x images.
I have something strange in my app.
If in the ressources I have 2 files named : myFile~ipad.png and myFile#2x~ipad.png the retina image is loaded on iPad retina as it should be.
But If i have two files named myFile.png and myFile#2x~ipad.png, the retina images is never loaded and myFiles.png is used for all devices.
Is this normal ? The problem is that I want to use the image myFile.png for iPhone, iPhone retina and iPad and the image myFile#2x~ipad.png for iPad retina so I can't put the extension ~ipad beyond myFile.png.
Use symlink. I just google it, and didn't say it couldn't be done, but most of it points to symlink in an SD card.
You can have the same image "myFile.png" with different name as myFile~ipad.png so that you can have same result for iPhone, iPhone retina and iPad. And "myFile#2x~ipad.png" image for ipad retina display.
hope this will help.
We tried using symlinks, but it turns out that in the built app, the symlinks actually turned into copies of the images they linked to. Xcode resolves symlinks by copying the source file. So you can use symlinks for convenience, but not to save storage space in the built app.
So I'm currently making an app that supports both iphone 3gs and ipad (this is a universal binary app).
What I'm wondering is how will iphone 4 users view my app, will they see it pixelated? will they not see it full screen since my iphone 3gs is on a smaller resolution?
I don't have an iphone 4 yet but I'd rather just release this app as is - just for 3gs and ipad. Is there anything that I must know / any precautions etc? Oh (i just thought of this) is there an iphone 4.0 simulator so i can check out if my app works okay?
Thanks!
Basically any bitmap graphics (PNG files) will look a little blurry on the iPhone 4's Retina display.
The easiest way to fix this is to make double scaled versions (100x100 becomes 200x200) of all your PNG files and add them to your project suffixed with "#2x.png". In other words, MyBitmap.png will become MyBitmap#2x.png. Luckily your code doesn't have to change. On the iPhone 4 the OS will automatically choose a #2x.png instead of the regular one when you do:
UIImage *myBitmap = [UIImage imageNamed:#”MyBitmap.png”];
Xib files will also use the #2x.png if there is one available.
Other than that there's also launch images and Application Icons to worry about. This blog has a good summary.
Yes you can change your device type, by in the simulator pressing: Hardware->Device->iPhone 4 If you don't have it you might want download the latest devevloper tools.
Also you might have to press Window->Scale->100%