本文介绍了在UITableView中,什么是“visibleCells”的委托?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当单元格进出设备的屏幕时,我希望我的viewController确切地知道出现了什么以及出了什么。有没有办法做到这一点?

When cells come in and out of device's screen, I want my viewController to know exactly what came and what went out. Is there a way to do this?

推荐答案

可见单元格没有委托方法。当细胞离开屏幕时没有任何调用。当单元格变得可见时,确实没有任何东西。

There isn't a delegate method just for "visible cells". There isn't anything called when a cell leaves the screen. There really isn't anything when a cell becomes visible.

cellForRowAtIndexPath 数据源方法。当需要单元格时调用它。

There is the cellForRowAtIndexPath data source method. This is called when a cell is needed.

willDisplayRowAtIndexPath 委托方法。这将在显示单元格时调用。

There is the willDisplayRowAtIndexPath delegate method. This is called when a cell will be displayed.

didEndDisplayingCell 委托方法。从表视图中删除单元格时调用此方法。

There is the didEndDisplayingCell delegate method. This is called when a cell is removed from the table view.

<$ c上有 indexPathsForVisibleRows 方法$ C>的UITableView 。这可以让您知道当前查看的行。

There is the indexPathsForVisibleRows method on UITableView. This lets you know what rows are currently in view.

prepareForReuse 方法>的UITableViewCell 。这使得单元格重置自身可以重复用于另一行。

There is the prepareForReuse method on UITableViewCell. This lets a cell reset itself to be reused for another row.

更好地描述您要完成的任务以获得更具体的答案。

Better describe what you are trying to accomplish in order to get a more specific answer.

这篇关于在UITableView中,什么是“visibleCells”的委托?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-11 17:43