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]];

posted @ 2013-09-18 08:59  zhangze  阅读(308)  评论(0编辑  收藏  举报