Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/110.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 设置动画时tableView.setContentOffset不工作=False_Ios_Swift_Uitableview - Fatal编程技术网

Ios 设置动画时tableView.setContentOffset不工作=False

Ios 设置动画时tableView.setContentOffset不工作=False,ios,swift,uitableview,Ios,Swift,Uitableview,当我打电话时 tableView.setContentOffset(CGPoint(x: 0.0, y: CGFloat(startIndex * cellHeight)), animated: true) 然后,tableView加载滚动到所需的高度“startIndex*cellHeight”(这实际上是将单元格定位到tableView的顶部) 但是,当我将动画更改为false时,它不起作用。您知道如何解决此问题吗?您在哪里使用此代码?你能发布你所有的相关代码吗?你解决了你的问题吗?我也有

当我打电话时

tableView.setContentOffset(CGPoint(x: 0.0, y: CGFloat(startIndex * cellHeight)), animated: true)
然后,tableView加载滚动到所需的高度“startIndex*cellHeight”(这实际上是将单元格定位到tableView的顶部)


但是,当我将动画更改为false时,它不起作用。您知道如何解决此问题吗?

您在哪里使用此代码?你能发布你所有的相关代码吗?你解决了你的问题吗?我也有同样的问题。self.tableView.setContentOffset(CGPoint(x:0,y:44),animated:false)我不知道它的工作原理。您在哪里使用此代码?你能发布你所有的相关代码吗?你解决了你的问题吗?我也有同样的问题。self.tableView.setContentOffset(CGPoint(x:0,y:44),动画:false)我不知道它是怎么工作的。