I have a custom UITableViewCell that takes up a portion of the screen. However, when there is only one row of data, I’d like the UITableView (that I dropped in with IB), to shrink and only show the one row. Is there a way for the UITableView to redraw itself? Thanks.
Share
You can set the tableView height using the following code:
If you want to animate the height change you need to do:
You can put all of the above code in a method which you can call when your
numberOfRowsInSectiondata source method returns a value of 1.