所以,我有一张桌子,可以这么说,我在桌子上做了一个小小的“黑客”。"hack“是创建一个UIView,其颜色和高度都比实际的(现在是透明的)单元格要小,这样看起来就像所有单元格之间都有间距一样。
我现在的问题是,从“想象的”单元到实际的单元格有10个单位的间隔。这意味着当我添加我的UITableViewRowAction时,它将如下所示:

显然我希望它有同样的高度。
func tableView(_ tableView: UITableView, editActionsForRowAt indexPath: IndexPath) -> [UITableViewRowAction]? {
let more = UITableViewRowAction(style: .normal, title: "More") { action, index in
print("more button tapped")
}
more.backgroundColor = UIColor.gray
return [more]
}这就是我现在拥有的..。但我真的不知道我会如何调整高度
发布于 2016-10-27 16:37:30
我把问题看错了。您真正需要知道的是,您是否为tableViewCell的编辑操作提供了自定义视图。这里有一个详细的教程:https://www.raywenderlich.com/62435/make-swipeable-table-view-cell-actions-without-going-nuts-scroll-views
https://stackoverflow.com/questions/40289824
复制相似问题