开发者

XCode Universal Application Switching nib/xibs

开发者 https://www.devze.com 2023-04-11 05:27 出处:网络
So I have an application already built and I\'m in charge of making it a Universal App. I am using XCode 4.1 and made the app Universal.It did all the great plist and creation of a new mainwindow stuf

So I have an application already built and I'm in charge of making it a Universal App. I am using XCode 4.1 and made the app Universal. It did all the great plist and creation of a new mainwindow stuff. When I run it on the device/sim I get an ipad view with a smaller window size like I expected. Each of the app's views are very graphical and uses images set to the correct size. I also have different size art for the different possible screens.

My understanding is that if I re-create an iPad version of each of the views ie. MainMenuViewController uses the MainMenuViewController.xib, I can just create a MainMenuViewController-iPad.xib and then tell it to load that instead of the main view.

How do I go about tell开发者_JAVA技巧ing it to use the other view AND does this work for the iPhone 4 Retina display as well? Do I need a MainMenuViewController-Retina.xib as well?

Thanks for any and all help?


You can use a conditional statement that checks the userInterfaceIdiom value in UIDevice to see if you are on iPad or iPhone. Then call the appropriate XIB.

For retina displays the approach is different. You will use exactly the same XIB but you need to just provide a high res version of each of your graphics and name it the same as its low res counterpart but add an @2x to the end of the name. (myImage.jpg, myImage@2x.jpg).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号