Hacking Bear Hacking Bear - 1 year ago 89
iOS Question

How to set UITableView background for blank space?

I attempted to use UITableView (with static content) to create a setting screen similar to the iPhone's system setting screen. It mostly works excepts the blank space under the last row are filled with white row cells instead of background color, as shown in this screenshot:

enter image description here

I have tried various ways to fix this: setting the table view's background, add an empty row as the last row with the background color. What should be the right fix?

Answer Source

Use UITableView(style: .Grouped) in Swift or [[UITableView alloc] initWithStyle: UITableViewStyleGrouped] in Objective-C to emulate the appearance of the settings menu. You should also be able to set the table view style in the interface builder.