Multi-Resolution Device

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.

0 komentar:

Post a Comment

  • Digg
  • del.icio.us
  • StumbleUpon
  • Yahoo! Buzz
  • Technorati
  • Facebook
  • TwitThis
  • MySpace
  • LinkedIn
  • Google
  • Reddit
  • Netvibes
Design by Blogger Tune-UpCopyright © 2011 Gadget Reviews Update 2012 | Powered by Blogger