增加表视图单元格默认附件类型的高度



我是iPhone开发的新手。我正在使用UITableViewCellAccessoryCheckmark作为我的表视图单元格。我想知道是否可以以编程方式增加此默认附件类型的高度,否则使用自定义图像是唯一的选择。我想这样做,因为我想要我的单元格一个稍大的复选标记。任何帮助不胜感激

谢谢拉吉

选标记附件类型的大小无法更改.....您可以做的是在UITableViewCell中添加UIButtonUIImageview,然后单击该操作。将图像添加到单元格相对容易。

为此,您必须实现自定义附件类型,只需通过以下教程:链接

cellForRowAtIndexPath 在此表视图方法中使用此代码

UIButton *record_Btn = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[record_Btn setFrame:CGRectMake(8, 5, 70-20, 35)];
[record_Btn setBackgroundColor:[UIColor clearColor]];
[record_Btn setTitle:[NSString stringWithFormat:@"record"] forState:UIControlStateNormal];
record_Btn.tag = cell.tag;
[record_Btn addTarget:self action:@selector(pressRecordBtn:) forControlEvents:UIControlEventTouchUpInside];
[cell.contentView addSubview:record_Btn];

相关内容

最新更新