当 tableView 进入编辑模式时,我在自定义单元格的布局中看到一些非常奇怪的行为。
内容 View 似乎变得非常小,并移至单元格的右侧。
有人知道这里会发生什么吗?
编辑:
可以从 dropbox here 获取此问题的非常简化版本的代码
最佳答案
评论后编辑:
尝试注释掉下面的行。
cell.layoutMargins = UIEdgeInsets(top: 0, left: UIScreen.mainScreen().bounds.width, bottom: 0, right: 0)
当行被重新定位时...
... The delegate assigns the controls in tableView:cellForRowAtIndexPath: by setting the showsReorderControl property of UITableViewCell objects to YES
因为您在cellForRowAtIndexPath
中再次设置layoutmargins,所以它可能会覆盖形成的附件 View 并重新绘制单元格布局。
关于ios - 编辑模式下的 UITableViewCell 子类布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37037316/