How can I extend a UITableView to fill full screen on iPhone 5 using Interface Builder?

Can I extend a UITableView with static cells to automatically adjust to the 4-inch iPhone 5 screen and increase the height of each UITableViewCell accordingly? If I create a simple UITableView in IB with 3 static lines, when I view it on iPhone 3.5, โ€œthe display looks fine, but on iPhone 4โ€ appears at the bottom. I tried to play with autorun (I'm only interested in iOS6), setting autorun options, etc. but to no avail.

By the way - I know that I can set the height in the code, for example. in heightForRowAtIndexPath: divide the border or frame height by the number of lines (i.e. 3 lines). But I'm looking for something more dynamic.

example of iPhone resizing issue on 3.5 "and 4"

+8
ios uitableview autolayout interface-builder
source share
3 answers

The problem was resolved by setting the AutoLayout property in the TableView. As soon as I did this, the table changed accordingly. Subsequently, I also found that I could take care of resizing by setting the AutoSize mask.

+3
source share

I had a similar problem. In Xcode 6.4, I added restrictions to my UITableView in the storyboard.

enter image description here

+2
source share

Another way to solve (this worked for me) is to click on the โ€œApply 4-inch form factorโ€ button and expand the UITableView to the bottom of the screen.

enter image description here

+1
source share

All Articles