-2

I'm trying to pin all labels and buttons using auto layout. But it seems to be impossible. I've tried almost everything (tutorials also - been there done that), and it still sucks. On every device (Iphone 7plus, 6) it looks much different, sometimes labels hide, or disappear.

Could somebody take a look at my storyboard? https://drive.google.com/file/d/0B68OpxRinURkR2lLSFhXRmZZWms/view

This is how it should looks:

enter image description here

belab
  • 117
  • 3
  • 12
  • add screenshot for that screen where problem exact occurs . – KKRocks Apr 24 '17 at 12:38
  • You stroyboard doesn't even contain one costraint. Please add what you have tried, in accomplishing the desired autolayout. – Saurabh Yadav Apr 24 '17 at 12:40
  • Plus you view should be added on a scroll view, so that the view moves up when you start typing in the textfields. – Saurabh Yadav Apr 24 '17 at 12:42
  • Cause I deleted all. https://drive.google.com/file/d/0B68OpxRinURkN1F6dVRHamtuX2c/view?usp=sharing The main problem is I cannot set it to scale correctly in Y axis. – belab Apr 24 '17 at 12:52
  • Did you try my [series of posts](http://sketchytech.blogspot.co.uk/search/label/Fear%20and%20Loathing%20in%20Auto%20Layout) on the subject? I was faced with the same problem as you and so took the time to document it as simply as I could. Really there is no solution except to understand the logic of the system, because if someone takes the time to fix this instance (which is a big ask!) then next time you'll need help all over again. – sketchyTech Apr 24 '17 at 13:03

2 Answers2

0

The simplest approach to build this desired layout is to use UITableViewController with static cells. Adding the required labels in each cell and setting up its very basic constraints will help you build what you are trying. It will also remove the need of handling the ScrollView for handling the keyboard input when user taps in the TextFields. There is nothing complex in this view.

Gurdev Singh
  • 1,996
  • 13
  • 11
0

Based on what you've posted, and your previous question (by the way, you shouldn't have posted this almost identical question - you should have edited / continued with your previous one, but anyway)...

It looks like you are trying to align labels and fields with elements on your background image. Since the scaling of the image changes relative to the other objects, that will almost certainly fail.

Try splitting up your visual elements, and then using views and subviews to combine and arrange them:

enter image description here

DonMag
  • 69,424
  • 5
  • 50
  • 86