【问题标题】:UITableView's last row's separator is disappearing/reappearingUITableView 的最后一行的分隔符正在消失/重新出现
【发布时间】:2013-11-28 18:20:10
【问题描述】:

我正在为 iOS 7 开发,我注意到对于非分组表视图,最后一行的底部分隔符有时会出现有时会消失。如果我选择该行,它通常会导致它消失,但有时我会得到相反的行为。有没有其他人遇到过这个问题?

【问题讨论】:

  • 请显示为单元格添加分隔符的代码
  • 使用 tableview 的默认分隔符样式。无论单元格是否设置了 separatorInset 属性,都会出现此问题。
  • 同样的问题。解决方法是在自定义 UITableViewCell 中创建自己的分隔符。
  • 这也可以出现在最顶层的单元格中。在自定义 UITableViewCell 中创建自己的分隔符

标签: ios ios7 uitableview


【解决方案1】:

创建您自己的单元格分隔符并将其添加到您的单元格中

 UIImageView *customSeperator=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"YourOnePixelImg.png"]];

 [customSeperator setFrame:CGRectMake(0, cell.frame.size.height-3, cell.frame.size.width, 2)];

 [cell  addSubview:customSeperator];

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-27
    • 2012-12-21
    相关资源
    最近更新 更多