这是我的代码,
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:@"Cell"];
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
if ([cell.textLabel.text isEqualToString:@"Small" ]) {
    cell.imageView.image=nil;
    cell.accessoryView = nil;
    cell.accessoryType=UITableViewCellAccessoryCheckmark;
    return cell;
}但是复选标记正在添加到单元格的右角,我想将其添加到单元格内的另一个位置,如下所示,
[[chkmrk alloc]initWithFrame:CGRectMake(200, -4, 100, 50)];发布于 2013-09-11 16:53:06
不可以更改UITableViewCell的accessoryView的位置。您需要自定义您的单元格。
例如在cell.contentView中添加按钮,将图像(选中/取消选中图像)放在按钮上,并通过按钮tag在其点击事件上对其进行管理(选中或取消选中)。
https://stackoverflow.com/questions/18736630
复制相似问题