UITableViewHeaderFooterView背景色问题

2018-06-27  本文已影响698人  joeal

UITableViewHeaderFooterView背景色问题

问题发生

在一个tableview中创建了SectionHeaderView或者SectionFooterView。但是运行程序的时候在控制台打印了如下log:

[TableView] Setting the background color on UITableViewHeaderFooterView has been deprecated. 
Please set a custom UIView with your desired background color to the backgroundView property instead.
问题解决

一、UITableViewHeaderFooterView是由代码创建的

1、创建UIview作为背景,并设置想要的背景颜色

二、UITableViewHeaderFooterView是由Xib创建的

1、创建UIview作为背景,并设置想要的背景颜色

2、把xib中的把backgroundcolor改成default就不会有提示了
上一篇 下一篇

猜你喜欢

热点阅读