【发布时间】:2011-02-03 19:46:48
【问题描述】:
我有一个基本的 UITableView,我想在没有选择样式的情况下启用 Mail.app 样式复选标记。我有以下sn-p:
#define UITableViewCellEditingStyleMultiSelect (3)
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView
editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath
{
return UITableViewCellEditingStyleMultiSelect;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
但是,这将永远不会在选择时显示复选标记(尽管会显示空圆圈)。关于如何解决它的任何想法?我知道它使用了未记录的功能,但我真的很想添加对复选标记的支持。我的实际示例使用了一个非常自定义的UITableViewCell,我无法启用选择样式!
【问题讨论】:
标签: iphone cocoa-touch uitableview