2012-08-09 36 views
0

Iam新增iphone開發。我爲我的表格視圖單元格使用UITableViewCellAccessoryCheckmark。我想知道是否可以通過編程方式增加此默認附件類型的高度,否則使用自定義圖像是唯一的選擇。我想這樣做,因爲我想爲我的單元格選擇一個稍大的複選標記。任何幫助表示讚賞增加表格視圖單元的高度默認附件類型

感謝, 拉吉

+0

我想在這裏你可能會得到的想法 - [點擊此鏈接] [1] [1]:http://stackoverflow.com/questions/10208998/replace-the-default-checkmark-for-uitableview-with-a-custom-image – Nayan 2012-08-09 05:27:28

回答

1

勾選附件類型不能改變的大小.....你可以做的就是添加一個UIButtonUITableViewCell,並在其點擊一個UIImageview執行行動....添加圖像到細胞相對容易....

+0

是的,將圖像添加到單元格很容易。感謝您的快速回復。我會接受您的回答 – Raj 2012-08-09 05:36:04

+0

歡迎您:) – IronManGill 2012-08-09 05:39:40

0

對於這一點,你必須實現自定義accessoryType剛剛經歷以下教程: link

0

細胞ForRowAtIndexPath此表視圖方法使用此代碼

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]; 
相關問題