-1

I have an iOS 5 app I am moving to iOS 7.

Not much is going to change, but I would like to be able to do the following to make the screens nicer.

I have a collection of Text labels, image boxes, etc on a tabbed window.

On the 3.5 it looks great.

On the 4 in screen it is toward the top too much.

I would like to move down the group to center it more on the 4 in screen.

I was thinking I could use something like if([UIScreen mainScreen].bounds.size.height>=568)

And then store an offset, but I am not having much luck.

The goal is to group this set of objects and just move then down the screen if the screen is 4 in. We only operate in Portrait so that should be easy enough.

I will then have to do the same thing in the iPad code. Any gotchas there?

Ian

1 Answers1

0

Seems fine to me, I don't see whats wrong... Have you look into Auto Layout yet. It was introduced in iOS 6 and handles resizing for screens automatically. See the following links:

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/AutolayoutPG/Introduction/Introduction.html

http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1

Also: Here is the code you need to check for 4-inch screen:

CGRect bounds = [[UIScreen mainScreen] bounds];
if (bounds.size.height == 568) {
  // 4-inch screen
 } else {
  //3.5-inch screen
}
virindh
  • 3,775
  • 3
  • 24
  • 49