English 中文(简体)
How do I write an iPhone/iPad app to take care of different screen sizes?
原标题:

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?

最佳回答

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.

问题回答

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.

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





相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签