HTML5   发布时间:2022-04-27  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了ios – 页脚视图的颜色总是比UITableView分隔符的颜色更暗大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
在我的UITableView中,我设置了这样的分隔符颜色:
- (void)viewDidLoad {
  ...
  self.tableView.separatorColor = [UIColor lightGrayColor];
  ...
}

我像这样设置页脚的颜色:

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {

  UITableViewHeaderFooterView *footerView = [[UITableViewHeaderFooterView alloc]
                                             initWithFrame:(CGRect){0,320,1}];
  footerView.contentView.BACkgroundColor = [UIColor lightGrayColor];

  return footerView;
}

但是,页脚视图的颜色总是比分隔符的颜色更暗,如下所示:

如何让它们成为完全相同的颜色?谢谢.

解决方法

从iOS 6.0开始,您可以使用下面提到的UITableView的委托方法来更改页脚视图的背景颜色 –
- (void)tableView:(UITableView *)tableView willDisplayFooterView:(UIView *)view forSection:(NSInteger)section 
{
    //Set the BACkground color of the View
    view.TintColor = [UIColor blueColor];
}

大佬总结

以上是大佬教程为你收集整理的ios – 页脚视图的颜色总是比UITableView分隔符的颜色更暗全部内容,希望文章能够帮你解决ios – 页脚视图的颜色总是比UITableView分隔符的颜色更暗所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。