Wednesday, January 27, 2010

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.



5 comments:

Joel Bernstein said...

I haven't looked at the 3.2 api docs yet, but I'd think if you were running a 3.1 app on an iPad, [screen bounds] would return the fake iPhone screen size, not the iPad screen size.

Note that I'm totally talking out of my ass here, but it seems to me that if they didn't do this, any iPhone app that depended on getting certain values from [screen bounds] would behave incorrectly on the iPad.

Jeff LaMarche said...

Well, it would if you specified that your app didn't run on the iPad natively.

Edwin said...

scrub m65 kamagra attorney lawyer body scrub field jacket lovegra marijuana attorney injury lawyer

SEO Services Consultants said...

Nice information, many thanks to the author. It is incomprehensible to me now, but in general, the usefulness and significance is overwhelming. Thanks again and good luck! Web Design Company

h4ns said...

What youre saying is completely true. I know that everybody must say the same thing, but I just think that you put it in a way that everyone can understand. I also love the images you put in here. They fit so well with what youre trying to say. Im sure youll reach so many people with what youve got to say.

Arsenal vs Huddersfield Town live streaming
Arsenal vs Huddersfield Town live streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Wolverhampton Wanderers vs Stoke City Live Streaming
Notts County vs Manchester City Live Streaming
Notts County vs Manchester City Live Streaming
Bologna vs AS Roma Live Streaming
Bologna vs AS Roma Live Streaming
Juventus vs Udinese Live Streaming
Juventus vs Udinese Live Streaming
Napoli vs Sampdoria Live Streaming
Napoli vs Sampdoria Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
Fulham vs Tottenham Hotspur Live Streaming
AS Monaco vs Marseille Live Streaming
AS Monaco vs Marseille Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Alajuelense vs Perez Zeledon Live Streaming
Technology News | News Today | Live Streaming TV Channels