Search code examples
iosiphoneobjective-cios7autolayout

What is the need to resize subviews programmatically when using storyboards?


I am well versed with custom views. Today I have started using storyboards & I am not able to convince myself on the usage of storyboard.

Problem: - I have set up by View Controller in storyboard. - Running on simulator 4 inch, I am good to Go with the layouts of Views. - Running on simulator 3.5 inch, I am upset, as my view is partially visible.

Here are screen shots.

  • My SotryBaord (Look at the "Delete User" Button).

    enter image description here

  • Delete User button frame:

    enter image description here

  • Running on Simulator 4 inch

    enter image description here

  • Running on Simulator 4 inch (I have problem)

    enter image description here

how do I get the frame adjusted with layouts so that it runs clear in both size iPhones. My delete user button should not go off the screen.


Solution

  • Mate, Auto layout is somewhat complex, you need to master it while giving lot of time, but if you want to finish it in minutes, just uncheck the auto-layout, select every UI element and set its auto-resizing like this enter image description here.

    You can change the auto-layout differently, and can see the changes by just tapping this button enter image description here

    Hope this will help and save time.