views:

1367

answers:

3

With the new iPad (which has a different screen resolution of the iPhone/iPod Touch), how do I set the application to automatically size appropriately to the desired screen size?

+1  A: 

Although the iPad SDK is still under NDA at this time, the iPhone SDK which preceeds it introduced the ability to change the screen size:

- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)opts
{
  UIScreen *s = [UIScreen mainScreen];    // ask for the main screen
  [window setFrame:[s applicationFrame]]; // get the application Frame for the screen
  return YES;
}

If you have used NIBs for the UI construction, you need to ensure that they're auto-resizable in order for them to flow properly.

AlBlue
+2  A: 

Read the iPad Programming Guide in the 3.2 SDK beta documentation. It will tell you everything you need. The NDA means we can't talk about it here publically.

Mike Weller
A: 

The issue is not in the code. It is in the project conversion from iPhone to iPad: http://www.cocos2d-iphone.org/forum/topic/4108

Wayne Lo