0

I am new to swift and ios world. I am trying to figure out how can i design my login page so that it can fullfill entire screen of different iphones available. I have designed a login page for iphone 5s but as i preview same screen in iphone 8 it shows me lot of space is available UI look and feel is gone. How can i manage spaces/ Height between UI views so that it will look exactly across all iphone. I came to know size class are available but as per my understanding size class are same for all iphone different for ipad. What can i do here please suggest

Iphone SE preview

ihpone 4S preview

LinusGeffarth
  • 27,197
  • 29
  • 120
  • 174
Feroz Siddiqui
  • 3,840
  • 6
  • 34
  • 69
  • 1
    Please take a look at AutoLayout: https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/index.html – SrB Oct 19 '17 at 21:14
  • You will have to look deep into auto layout, constraints and stack views. https://developer.apple.com/videos/play/wwdc2015/218/ and https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/LayoutUsingStackViews.html – Leo Dabus Oct 19 '17 at 21:15
  • @user8744067 firstly your question is 2 broad . What you can do is add UIView on controller having device height and width. Then give that view leading,trailing,top and bottom constraints (no height and width ) . Now keep another view in center of that view , and adjust size accordingly. Give that view center constraints related to super view, and inside that subview make your login design.Its all about practice and checking different results. – Tushar Sharma Oct 19 '17 at 21:18
  • In preview i can see that view leading,trailing,top and bottom constraints need to be increased for different iphone how can i achieve this as size class wont help for same compact width regular height phone. i want to edit the constrains height, top and bottom constraints – Feroz Siddiqui Oct 19 '17 at 21:22
  • i have uploaded the screenshot also for the reference – Feroz Siddiqui Oct 19 '17 at 21:28
  • You simply need to decide where you want the extra space to go. You could put everything in a stack view and constrain the stackview to the safe area and have the stackview distribute your elements equally or you could put all of your elements in a UIView and constrain that view to the vertical center; the extra space would then be equally distributed at the top and bottom of the form – Paulw11 Oct 19 '17 at 22:46

0 Answers0