2017-03-02 39 views
0

我在使用静态单元格时出现问题,每当我们向下滚动或向上滚动时,所创建的单元格将深度添加到最底层,因此如果单元格的视图大于细胞大小,该视图将在下一个小区 enter image description here滚动时重新排序UITableViewCells

我想说明,当用户按下信息按钮,而且可以肯定的提示会比单元尺寸大的工具提示覆盖,所以它会被覆盖由下一个单元格。

我用AMPopTip的提示

回答

0

你想显示AMPopTip在什么看法?然一个快速测试,这似乎工作(在一个UITableViewController类):

override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { 

    let rectOfCell = tableView.rectForRow(at: indexPath) 
    let rectOfCellInSuperview = tableView.convert(rectOfCell, to: tableView.superview) 
    popTip.showText("test \(indexPath)", direction: .down, maxWidth: 200, in: self.view, fromFrame: CGRect(x: rectOfCellInSuperview.size.width/2, y: rectOfCellInSuperview.origin.y + tableView.contentOffset.y + rectOfCellInSuperview.size.height/2, width: 1, height: 1)) 

} 

编辑:哎呦,忘了考虑滚动偏移 - 固定...... D'哦!