Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/101.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios “表格视图”单元格高度在部分滑动单元格后收缩_Ios_Swift - Fatal编程技术网

Ios “表格视图”单元格高度在部分滑动单元格后收缩

Ios “表格视图”单元格高度在部分滑动单元格后收缩,ios,swift,Ios,Swift,使用SwipeCellKit的表视图控制器 使用设置行高度 cell.textLabel?.numberOfLines = 0 //allows row size to expand cell.textLabel?.lineBreakMode = .byWordWrapping 还尝试: tableView.rowHeight = UITableView.automaticDimension tableView.estimatedRowHeight = UITableView.automat

使用SwipeCellKit的表视图控制器

使用设置行高度

cell.textLabel?.numberOfLines = 0 //allows row size to expand
cell.textLabel?.lineBreakMode = .byWordWrapping
还尝试:

tableView.rowHeight = UITableView.automaticDimension
tableView.estimatedRowHeight =  UITableView.automaticDimension
打开tableviewcontroller时,单元格高度正确。 当我向左滑动但再次单击时决定不删除单元格时,单元格大小将缩小为两行。 如果我离开“表视图”控制器并返回,单元格高度将再次正确

视频示例:

试试这个:

tableView.rowHeight = UITableViewAutomaticDimension
tableView.estimatedRowHeight = 270
estimatedRowHeight
一个更高的值,而不是使用
UITableView.automaticDimension

将下表视图委托方法添加到代码中:

func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
return UITableView.automaticDimension
}

}


希望您在故事板中为单元格内的标签提供了适当的(
顶部、底部、前导和尾随)约束。

感谢您的反馈,不幸的是,没有起作用。。。。最终删除了SwipeCellKit,自己创建了swipe操作,解决了问题。
 override func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat {
  return UITableView.automaticDimension