Search code examples
ioslayoutstoryboardspaceiphone-5

How to specify that a view should take up the rest available space?


I'm targeting iPhone 4 and iPhone 5, so I want my view to take as much available space as possible. For example, I want the the table view to take the remaining space according to iPhone 4 and iPhone 5 screen.

enter image description here

Is there any option (Storyboard or code) so that I can do this? Like Height="*" in XAML or weight in Android.


Solution

  • enale autolayout like this

    enter image description here

    & write below code

    self.tableView.autoResizingMasks=UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth