Why two identical views have different layouts when run?

KrisAdamsKrisAdams GBMember ✭✭

Hi there,

I am having a confusing problem with the IOS layout using Main.Storyboard.
I have two UIControllers, seemingly identical to me. I have checked all controls on them and made sure the properties look identical (clicking back and forth between controls on one and the corresponding control on the other, to see if anything is different in the properties. It all looks the same.

I clicked on each control and clicked the Remove Contraints button. So it seems like they are all Auto Layout.

My first Page, when run, looks fine, the controls are where I put them in the designer. But when I go to the second page, they are all funky. As if some sort of layout issue is happening.

I am new to this layout stuff in IOS, and have read through the documentation, but can't seem to figure out why one works and the other doesn't.

Any help would be appreciated.


  • adamkempadamkemp USInsider, Developer Group Leader mod

    It would help if you attached a project that included them and demonstrated the issue.

  • KrisAdamsKrisAdams GBMember ✭✭

    Are you the guy who can help me? I could privately send you my project, but I don't want it public.

  • KrisAdamsKrisAdams GBMember ✭✭

    I still have no idea what the actual issue was with the layout, but luckily they were so similar in visuals, I just deleted my second UIViewController, and copy-pasted the first one, then pointed to the second one's class. And now they're both working.

    It was so strangely not-obvious what the problem was, because according to me, the second one is exactly the same as it was before..

    But its working now, so thanks for your interest, but I got it working.

Sign In or Register to comment.