UITableView 如何设置背景颜色

http://blog.sina.com.cn/s/blog_6734cee201011kya.html

原因:
1.backgroundView 属性不为nil,所有设置backgroundColor 没有意义
@property(nonatomic, readwrite, retain) UIView *backgroundView __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2); // the background view will be automatically resized to track the size of the table view.  this will be placed as a subview of the table view behind all cells and headers/footers.  default may be non-nil for some devices.

解决方法:
[self.tableView setBackgroundView:nil];
[self.tableView setBackgroundColor:[UIColor whiteColor]];

原文地址:https://www.cnblogs.com/xingfuzzhd/p/3327814.html