Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/20.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_Uitableview - Fatal编程技术网

Ios 快速滚动箭头,然后高亮显示该行

Ios 快速滚动箭头,然后高亮显示该行,ios,swift,uitableview,Ios,Swift,Uitableview,我想做的是scrollToRow,然后设置该行背景的动画,使其背景发生明显变化,以便用户可以看到确切的行 我有一个大约100行的表,当scrollToRow被触发时,它会滚动到右边的一行,但在其他行中会丢失。我只是希望用户能够更容易地发现该行…您可以使用以下任何解决方案,所有这些解决方案都可以正常工作: 滚动表格视图,直到索引路径标识的行位于屏幕上的特定位置 func scrollToRow(at indexPath: IndexPath, at scrollPosition: UITableV

我想做的是scrollToRow,然后设置该行背景的动画,使其背景发生明显变化,以便用户可以看到确切的行


我有一个大约100行的表,当scrollToRow被触发时,它会滚动到右边的一行,但在其他行中会丢失。我只是希望用户能够更容易地发现该行…

您可以使用以下任何解决方案,所有这些解决方案都可以正常工作:

滚动表格视图,直到索引路径标识的行位于屏幕上的特定位置

func scrollToRow(at indexPath: IndexPath, at scrollPosition: UITableViewScrollPosition, animated: Bool)
滚动表格视图,使最靠近表格视图中指定位置的选定行位于该位置

func scrollToNearestSelectedRow(at scrollPosition: UITableViewScrollPosition, animated: Bool)
滚动内容的特定区域,使其在接收器中可见。使用tableview的scrollview来实现此结果

func scrollRectToVisible(_ rect: CGRect, animated: Bool)
在表视图中选择由索引路径标识的行,可以选择将该行滚动到表视图中的某个位置

func selectRow(at indexPath: IndexPath?, animated: Bool, scrollPosition: UITableViewScrollPosition)

您可以使用selectRowat:animated:scrollPosition:@Rishab question updated代替滚动,这确实有助于我更接近必要的解决方案。