gpt4 book ai didi

ios - didDeselectRowAtIndexPath 问题

转载 作者:行者123 更新时间:2023-11-29 01:55:57 24 4
gpt4 key购买 nike

我在弹出窗口的 ScrollView 中有一个表格 View 。当显示 View 时,tableview 中的底部单元格对用户不可见。如果我选择所有单元格然后取消选择第一个单元格,那么 View 外的单元格也会被取消选择。有没有人遇到过这种行为?如果是,如何处理?

最佳答案

现在您的工作是找到表格 View 中的所有可见单元格,然后对其应用选择/取消选择。

UITableView *tableView = self.tableView; 
// Or however you get your table view

NSArray *paths = [tableView indexPathsForVisibleRows];

// For getting the cells themselves

NSMutableSet *visibleCells = [[NSMutableSet alloc] init];

for (NSIndexPath *path in paths)
{
[visibleCells addObject:[tableView cellForRowAtIndexPath:path]];
}

// Now visibleCells contains all of the cells you care about.

关于ios - didDeselectRowAtIndexPath 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30843144/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com