-->

Handling the larger device size of iPhone 5 [dupli

2020-08-01 04:40发布

问题:

This question already has answers here:
Closed 7 years ago.

Possible Duplicate:
How to deal with iPhone 5 screen size?

Watched the iPhone 5 keynote and yes the device height and a resolution of 640 X 1136. So I saw they showed how existing apps which work on that. But I believe if we use native components like tab bar, navigation bar etc. will work fine. But how about custom tab bars, navigation bars and controls which resides relative to the device orientation. So these are my questions.

1) How to handle custom layouts which has custom tab bars, navigation bars, relative contents etc.

2) Welcome screen. We will need 2 sizes right now. So in iPhone 5 do we need another 2 more for normal and retina?

3) If you carefully watched the keynote seems iPhone 5 will cut some portion of view from left and right so there is no any additional change in the app development. Has anybody noticed that?

回答1:

1) This depends on how you laid them out, you might need to adjust how you set the frame, change autoresizing masks etc, or if iOS 6 only is an option you could move to auto layout. Without knowing your code I cant give much more detail

2) There is no non-retina iPhone 5 so you only need 1 more Default.png size, named Default-568h@2x.png (btw adding this new sized default image is the trigger for iOS to show your app without letterboxing, so for some apps this is the only change which will need to be made)

3) This is the letterboxing I mentioned, it is what all current apps will do on the iPhone 5 until they are updated with a new default.png



回答2:

My understanding is that all existing apps will work on iPhone 5 and you will just have the black borders. However you will now have the capability to tailor apps to the bigger screen size. I imagine that there will now be a new sized .xib or storyboard that will match the size of the iPhone 5. You will be able to put an if statement in the app delegate to choose which .xib/storyboard to load based on the screen size. unfortunately now I think we will have to create multiple .xib/storyboard files, similar to how universal apps are made at the moment. The file loaded is selected based on the device.

Hope this helps