-4

I have an app made for a iPhone 5 screen and am having trouble making it so that it will look the same on a iPhone 4. I can't seem to figure out how to use both screen sizes without making 2 storyboards because there are about 35 views. Any answer that may help me fix this problem will be greatly appreciated.

Sincerely, Nick

~Beginner at IOS Development

rmaddy
  • 314,917
  • 42
  • 532
  • 579
macguy3
  • 15
  • 8
  • 1
    Autolayout is what you require. There are many, many tutorials on the web (mostly using Xcode 4) and Xcode 5 makes it easier still with realtime warnings of insufficient constraints and the ability to change screen-size at design time. In addition, Apple has published multiple WWDC videos that go through auto-layout in great detail. – Robotic Cat Dec 09 '13 at 15:53
  • possible duplicate of [How to develop or migrate apps for iPhone 5 screen resolution?](http://stackoverflow.com/questions/12395200/how-to-develop-or-migrate-apps-for-iphone-5-screen-resolution) – BRPocock Feb 28 '14 at 15:54

1 Answers1

2

Create the views more dynamic. For instance does a tableview fill up the extra space with rows. Autolayout can help increasing the distance between UIElements for this.

The old (iOS 6) way to disable iPhone 5 was not to submit the iPhone 5 Splashcreen. Afaik this "trick" isnt working anymore.

Best have a look on xcode 5. It can switch the storyboard from 4"to 3.5"on the fly and respects autolayout. Consider it as a great opportunity to get used to autolayout. (You will need it in the next gen of devices it seems)

Edit: Make sure the top most view does resizing and this resize is passed down to your table/collectionview

If you use Autolayout then just pin the 4 borders of the collection view, If you dont use autolayout, refer to picture 2 and make sure the autosizing behaves the same. Either way will work. enter image description here enter image description here

Helge Becker
  • 3,219
  • 1
  • 20
  • 33
  • I am on Xcode 5 now but am still having the problem. I want to make it so that the app will work on both 4' and 3.5' screens without having to use 2 storyboards. If possible can you give me some code or another way to achieve this. – macguy3 Dec 09 '13 at 15:54
  • Think this will be best for you: http://www.raywenderlich.com/50317/beginning-auto-layout-tutorial-in-ios-7-part-1 – Helge Becker Dec 09 '13 at 15:59
  • I have already tried that and it didn't help – macguy3 Dec 09 '13 at 16:01
  • Sorry? Rays courses are nothing to try, but to learn how to. What is so special about your UI that it cant be solved with autolayout? – Helge Becker Dec 09 '13 at 16:09
  • I have a app that i'm developing for my school. I am doing this by myself and can't seem to figure out how to fix this problem. When i turn on auto layout I can't use my UIScrollView and when it is enabled or disabled it doesn't help. When i switch to the 3.5' simulator the screen layout is still fitted for a 4' screen – macguy3 Dec 09 '13 at 16:14
  • I see. Hmm how about a collection/table view? The elements of the view are cells. The collection would take care of the content. I am editing my answer and add 2 pictures of an app we have in the store currently that uses this approach. (unfortunately German, Austria and Switzerland App Store only) – Helge Becker Dec 09 '13 at 16:22
  • Mine has a layout of this. I am uploading a image now http://imgur.com/CWmrrSO – macguy3 Dec 09 '13 at 16:23
  • Hmmm I see what you mean but my issue is different. As you can see in the link in my most recent comment I am doing more of a selection menu. you have any code that can help me fix this issue. The only problem is the main view. In the 3.5' simulator all the other views are fine it's just the main view – macguy3 Dec 09 '13 at 16:32
  • Looks fine to me. On a 3.5"screen you should be able to scroll as long the view gets resized. Did you disable resizing of subviews? Is the collectionview setup that he sticks to top and bottom? – Helge Becker Dec 09 '13 at 16:33
  • where would that be under i'm new at this and this is truly my first app – macguy3 Dec 09 '13 at 16:38
  • ok I found the resizing of subviews and disabled them everything works now but my toolbar is hidden how do i fix that – macguy3 Dec 09 '13 at 16:43
  • Hard to say with guessing how the storyboard is set up. Normally allowing resizing is the solution. Please see if my edit of the post helps with resizing subviews enabled. – Helge Becker Dec 09 '13 at 16:48
  • I've tried almost everything i can think of. Do you have any other ideas – macguy3 Dec 09 '13 at 17:06
  • Let someone look on the project. Cant be much wrong with it. helge.becker at europe.de if you like. Strip critical stuff out if there is any. After all its about the storyboard and why it behave not as it should. (could be the ViewController) – Helge Becker Dec 09 '13 at 17:15
  • I have just relized that there are some views that have not been resized when i'm on a 3.5' simulator. Any ideas on how to fix that. – macguy3 Dec 09 '13 at 18:27