我想改变的附件类型的所有单元格的UITableView上点击的条形按钮item.Is有任何想法或代码为此。
发布于 2011-05-24 15:09:07
只需获取一个标志(布尔值或其他值),然后在表视图上调用reloadData。并在cellForRowAtIndexPath中测试您的旗帜,并放置任何您想要的配件。
发布于 2011-05-24 15:12:21
在tableView:cellForRowAtIndexPath:中,
...
if ( selected ) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
...在点击该条按钮项时,
...
selected = YES;
[self.tableView reloadRowsAtIndexPaths:[self.tableView visibleCells] withRowAnimation: UITableViewRowAnimationNone];
...发布于 2011-05-24 15:11:13
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// some code
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}在这里,您可以检查条件并将单元格的附件类型更改为具有以下任意值
typedef enum {
UITableViewCellAccessoryNone,
UITableViewCellAccessoryDisclosureIndicator,
UITableViewCellAccessoryDetailDisclosureButton,
UITableViewCellAccessoryCheckmark
} UITableViewCellAccessoryType;https://stackoverflow.com/questions/6106853
复制相似问题