Is it possible to expand a UITableView
with static cells to adjust automatically to the 4" iPhone 5 screen and expand the height of each UITableViewCell
accordingly? If I create a simple UITableView
in IB with 3 static rows, when I view it on the iPhone 3.5" display it looks fine but on the iPhone 4" display there is extra whitespace at the bottom. I tried playing with autolayout (I'm only interested in iOS6), setting autosizing options, etc. but to no avail.
BTW - I know I can set the height in code e.g. in heightForRowAtIndexPath:
divide the bounds or frame height by number of rows (i.e. 3 rows). But I'm looking for something more dynamic.
The problem was resolved by setting the AutoLayout property on the TableView. Once I did this the table resized accordingly. I also subsequently discover that I could do take care of resizing by setting the AutoSizing mask.
I had a similar problem. In Xcode 6.4 I added constraints for my UITableView in the storyboard.
Another way to solve (this worked for me) is to click the Apply 4-inch form factor button and extend your UITableView to the bottom of the screen.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With