首页 > iOS开发,重用header或者footerview时,不能成功设置背景色怎么办

iOS开发,重用header或者footerview时,不能成功设置背景色怎么办

系统报的这个警告:
Setting the background color on UITableViewHeaderFooterView has been deprecated. Please use contentView.backgroundColor instead.


可以给这个UITableViewHeaderFooterView设置一个backgroundView
比如:
var backgroundView:UIView = UIView()
backgroundView.backgroundColor = UIColor.whiteColor()
self.backgroundView = backgroundView


UITableView的代理方法中,

这样就行了

【热门文章】
【热门文章】