Wednesday, January 27, 2010

Multi-Resolution Device

Posted by Hidayat Hidayat at 3:06 PM
I can't post SDK 3.2-specific code because it's under NDA, but I can post SDK 3.1 code. Now, let's say you wanted your application to be future-proofed to run properly in full-screen on some theoretical new device with more pixels than an iPhone. You might do something like this:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
UIScreen *screen = [UIScreen mainScreen];
[window setFrame:[screen applicationFrame]];
return YES;

This assumes that your nib is set up using autosize attributes to properly scale. If you need separate nibs, that's another blog posting that'll come after the NDA is lifted.


Post a Comment

Related Post


Copyright © 2011 Next Iphone | Store Mobile Phone Store