【问题标题】:iphone - table Cell color doesnt apply behind disclosure indicatoriphone - 表格单元格颜色不适用于披露指示符后面
【发布时间】:2010-11-19 13:57:53
【问题描述】:

我有一个表格视图,它具有备用颜色作为单元格的背景颜色。 除此之外,我还添加了一个披露指示器附件。 但是,问题在于单元格背景颜色似乎不适用于披露指示器“后面”的区域。在表格单元格的右端出现披露指示符之前,单元格背景颜色似乎被截断。

【问题讨论】:

  • 这是定制配件还是内置配件之一?可以截图吗?

标签: iphone tableview indicator background-color disclosure


【解决方案1】:

我遇到了类似的问题。这似乎是因为表中的每一行都分为几个部分。所以仅仅改变 cell.BackgroundColor 不会改变整个行的颜色。

尝试类似的方法。它对我有用:

UITableViewCell *bgView = [[UITableViewCell alloc] initWithFrame:CGRectZero];
    bgView.backgroundColor=indexPath.row % 2? [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]: [UIColor whiteColor];
    cell.backgroundView=bgView;

【讨论】:

  • % 2? 为我做了什么,它每隔一行做一次,我怎样才能得到所有的行?是除以 2 还是什么?
猜你喜欢
  • 1970-01-01
  • 2012-07-09
  • 2011-10-24
  • 2020-03-23
  • 1970-01-01
  • 2018-10-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多