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

时间:2012-08-09 05:22:39

标签: iphone objective-c xcode uitableview ios5

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

谢谢, 拉吉

3 个答案:

答案 0 :(得分:1)

复选标记附件类型的大小无法更改.....您可以执行的操作是在UIButton中添加UIImageviewUITableViewCell,然后点击其执行操作....将图像添加到单元格相对容易....

答案 1 :(得分:0)

为此你必须实现自定义accessoryType只需通过以下教程: link

答案 2 :(得分:0)

使用此代码的此表视图方法中的

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];
相关问题