How to make iPad use the #2x.png high res images in "2x" mode - iphone

I've read the documentation and googled until I couldn't google anymore, but still I cannot figure out how to make my iPhone app use the higher resolution images when displayed in "2x" mode on the iPad.
I have Icon.png Icon#2x.png and Icon-72.png and they work fine, but I don't want to have to rename all of my images. Also, the "2x" just seems to scale up pixels so text and IB objects look terrible. Is there a fix for this? Any suggestions would be greatly appreciated!
Note: This is not a universal app. I don't want to make it into a universal app. I just want it to scale up and look pretty on the ipad.

It is possible, at least in Cocos2D apps. Matt Rix does exactly this in his app Trainyard and it looks great on the iPad at 2x! He covers some of the details on his blog: Retinafy your Game.

Apple want you to write native iPad apps, so they deliberately don't support this, and there's no way to make it happen that I'm aware of.

You can register for the notification _UIClassicApplicationWillChangeZoomNotificationName and scale your graphics appropriately, i.e. by setting the rasterizationScale on the CALayer to the value returned by [[UIScreen mainScreen] scale].

Related

How to make app compatiable for iphone 4S and 5?

I am new to UI design, however a client wants an app ready for both iPhone 4s & 5.
I understand the iPhone 5 will create two bars if the image is not long enough. Many people said coding it at #2x will solve the problem. But I'm not sure exactly what that means.
Do I need to design two versions? What happens if I design only for iPhone 5? Will iPhone 4S users see a squished screen?
Thanks.
First, in a couple of months you'll have to support the iPhone 5's screen size. Apple have announced that it'll be a requirement soon.
Adding a Default.png of the right size is enough to enable an app to support the new screen size but is likely not enough. You'll also need to make sure that all your views resize to fill the screen. There's the old "springs and struts" method and the newer "constraints." There are tutorials you can search for -- Stackoverflow is not a good place for that kind of thing. You'll also need to update any images.
In short, try it in the Simulator and see what happens.
Using #2x is referring to whether or not the image asset is being displayed on a 'retina' screen. For example, if you had a 50x50 pixel image, the 'retina' (#2x) version would be 100x100. This is because 1pt (point) is equal to 2px (pixel) on a retina screen.
There are a variety of ways you can determine is it is an iPhone5 or iPhone4.
In the viewDidLoad, you could check the self.view.frame.size.height to determine which background image to load based on the height of the screen. This would require you to have two different versions of the assets (not including #2x versions), i.e. bg_iphone5.png & bg_iphone4.png.
There are other ways to accomplish this, and people have explained it better than I have here - search StackOverflow and you will surely find what you're looking for.
What happens if I design only for iPhone 5? Will iPhone 4S users see a squished screen?
Don't do this. Design for both.

iPad Content Scale Factor x2 for iPhone application

I'm hoping to recursively change every single View in my application to use the iPhone 4 graphics, and change the content scale factor to 2.0, such that it's the zoomed in version of my iPhone application on the iPad by default.
Currently, the iPad starts out in x1 Zoom, which is the 320x480 pixel version displayed on the 1024x768 real estate of the iPad, where the powers that be have declared that they're too cheap to actually invest in an iPad app, instead requesting that we have the application use iPhone retina graphics with a default content scale factor of 2.0
Upon googling and searching stackoverflow it seems my query is unique, though some questions are sort of similar such as -> Problem adapting scale factor for iPad x2 compatibility mode
And the best way to go about doing this remains undocumented, so I hope to implement this 'hack' so to speak in the best most succinct way possible.
If anyone has done this before, please share the code, otherwise I will update this with my own answer once I've figured it out.
The Answer: THIS CANNOT BE DONE.
The iPad will treat the screen as 480x320, even at 2x, so even if you change the contentScaleFactor appropriately and force it to use #2x.png images, you won't get any better resolution.
This is built into the iphone Operating system, only the Jailbroken iPads can get around this. Which isn't an option to consider.
It's easier to just duplicate the target for iPad, and realign the nib files appropriately, and make the app a Universal App.
It's a daft idea, and even if Apple change this in future SDK releases, it won't be backward compatible which again isn't an option, at least for our development team.
I think the best way to do it rules out using nib files.
If you create your views in code, you can easily use conditional code ([[UIDevice currentDevice] userInterfaceIdiom]) and based on that set the scale for the UIView elements.

How to make an iphone and iphone4-retina compatible app (done in cocoa) easily adapted to ipad?

My question is simple: when an iPhone app also supports retina display, it does not need an additional xib file. (Fonts and images are auto-scaled, you just need to prepare double-resolution images.) I want that retina view also applies to iPad and hence there's no additional xib files. (Scale a bit and leave a bit margin, maybe.) Yes, I just want it look bigger, but not in the low-resolution version scaled up from 320x480.
The iPhone, even with a retina display, is not an iPad. You can update your targets and xcode will convert automatically your views to use the entire screen of the iPad, but it won't make the application conforms to
1. Apple guidelines
2. Users expectations of an universal app.
But, as I said, if you do update your targets, your app might look relatively good (just programatically use UI_USER_INTERFACE_IDIOM to use the #2x.png version of your images).
Edit: I misunderstood your question, and now the corrected answer:
There's nothing you can do. The iPad will launch the app as an iPhone app (the small non retina display, pixelated if double sized) if it is defined as such in your plist, and iTunes Connect will sell your app as universal if it isn't defined as an iPhone in the info.plist.
You basically have little choice here but to port the app or to more or less forget about iPad users. And Apple certainly wanted things to be that way...

Easy ways to crop out the status bar when taking iOS Screenshots?

Apple recommends cropping out the status bar from screenshots submitted to the app store. Doing this manually in Preview is a very tedious and error-prone process.
Do any developers have any best-practices recommendations or automated techniques for speeding up this process? The goal would be to take as input iPad and/or iPhone screenshots, and output them with the toolbar cropped off. We need to support both portrait and landscape orientation, and Retina-resolution iPhone screens.
I've found a few utilities online that purport to help with this, but the ones I have found seem to fail on Retina-display resolution screens. And another that works via the iOS Simulator requires a 1920x1080 resolution monitor to process iPad screenshots - making it useless for non-17" laptop-based developers.
Any other recommendations for taking good screenshots for the AppStore? I know (based on my searching) that there are a lot of other developers who would be interested in a quicker workflow to handle this.
Bonus points for being able to bulk-process an entire directory.
I developed a free App, Status Barred which is on the Mac App Store. It crops your iOS screenshots from iPhone, iPad, portrait, landscape, normal & retina display.
I used the ImageMagick command line tools to batch crop all the Screenshot png files, but haven't figured out how to not use auto assigned output filenames.
convert Screenshot*.png -crop 640x920+0+40 920Screenshot.png
Here are two ways, assuming you mean status bar and not toolbar (which you probably shouldn't crop out of the screenshots).
If you have photoshop, just change the canvas size by subtracting 20 (low-res) or 40 (retina) and anchoring the bottom of the image. This works perfectly.
It's also easy in iPhoto using the Edit/Crop feature. Set the dimensions to the correct size (Portrait: 320x460 or 640x920 and Landscape: 480x300 or 960x600) and move the crop screen to the bottom of the image. This does it perfectly as well.
After much searching, the easiest tool I have found is the iOS Simulator Cropper. It does a great job of handling different resolutions and orientations, and it is painless to use. No need to muck around with Photoshop or other slow / cumbersome tools.
Link: http://www.curioustimes.de/iphonesimulatorcropper/index.html
The developer reports that they have enhanced the iOS Simulator Cropper to bulk process screenshots taken on device as well as via the Simulator. I haven't tried this yet since the update, but if it works well this will be the perfect solution.
I have also found a very useful tool in the Mac App store called "Status Barred" that also very simply crops the status bar out of any images handed to it.
How about just using Preview? Command+A to select all, drag the selection down to 920px then Tools => Crop.

iPhone 4 apps automatically scale up on iPad?

I thought I read/saw/heard something saying that apps built for iPhone 4's Retina Display would automatically run at 640x960 when installed on an iPad. However, can't find any documentation on that specific feature, and my app still runs at 320x480 when installed on an iPad.
Is there a step I've missed to make this happen? Or did I just imagine this being a feature?
Apps do not auto-upscale, BUT if you have an image larger than the UIImageView you are placing it in, you will get as large a version as the iPad can draw.
I don't think it knows to pull in #2x images, just ones that are actually larger than the space you are placing them into.
This is not the case; currently, apps won't auto-upscale on an iPad. Perhaps Apple will add this in iOS 4.x for iPad, but certainly there's been no indication from them that they will.