【问题标题】:UIView is removed when scrolling in UITableView在 UITableView 中滚动时移除 UIView
【发布时间】:2015-05-24 14:17:07
【问题描述】:

我创建了一个带有自定义单元格的 tableView。在 nib 文件中,我创建了一个名为 borderViewUIView。问题是当我向上或向下滚动然后向后滚动时,它会删除这个borderView?这可能是什么原因?

我已在 xib 文件中添加了一个 UIView,然后将其连接到 UITableViewCell 中的此属性

@IBOutlet weak var borderView: UIView!

然后在awakeFromNib()

borderView.backgroundColor = UIColor(rgba: "#e6e6e6")

【问题讨论】:

    标签: ios uitableview swift uiview


    【解决方案1】:

    当您滚动时单元格从屏幕上消失然后再次出现时,是否会发生这种情况?如果是这样,您想看看您的

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    

    因为该方法上可能有一些东西会覆盖您的 UIVIew。

    【讨论】:

      猜你喜欢
      • 2017-05-12
      • 1970-01-01
      • 2014-10-12
      • 1970-01-01
      • 2010-10-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多