问题
How can I check if a UITableViewCell is completely visible on the screen (not cut off by the tab or nav bar)?
I can get the visible cells with this code:
NSArray *indexes = [_tableView indexPathsForVisibleRows];
but I want to exclude cells that are not entirely visible in the screen.
回答1:
As you have, get the visible cells. The only ones that might be partial are the top and bottom ones. For each, check if its rect (rectForRowAtIndexPath:) is fully within the bounds of the table view (based on contentSize and contentOffset, using CGRectContainsRect).
来源:https://stackoverflow.com/questions/17309364/check-if-a-uitableviewcell-is-completely-visible