您的位置:首页 > 产品设计 > UI/UE

Setting the background color on UITableViewHeaderFooterView has been deprecated. Please use contentV

2017-05-24 17:39 393 查看

提示:

Setting the background color on UITableViewHeaderFooterView has been deprecated. Please use contentView.backgroundColor instead.

当时设置tableView组头视图的颜色时写法如下

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
view.backgroundColor = [UIColor lightGrayColor];
}


这种设置组头视图背景颜色的方法已经被摒弃了

正确写法:

- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
UITableViewHeaderFooterView *headerView=(UITableViewHeaderFooterView *)view;
[headerView.backgroundView setBackgroundColor:[UIColor lightGrayColor]];
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐