0
我在表格的每個表格視圖單元格上添加了一個自定義的UIButton。我將這個按鈕分配給AccessoryDetailDisclosureButton。所以在堅果殼中,它是一個自定義的AccessoryDetailDisclosureButton。這是我如何的cellForRowAtIndexPath做:AccessoryDetailDisclosureButton action
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] ;
UIButton *ACC = [UIButton buttonWithType:UIButtonTypeCustom];
ACC.frame = CGRectMake(0, 0, 25, 25);
if(iPhone)
{
[ACC setImage:[UIImage imageNamed:@"select_arrow.png"] forState:UIControlStateNormal];
}
else
{
ACC.frame = CGRectMake(0, 0, 60, 60);
[ACC setImage:[UIImage imageNamed:@"[email protected]"] forState:UIControlStateNormal];
}
cell.accessoryView = ACC;
cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
}
現在的問題是, 我希望把AccessoryDetailDisclosureButton同樣的動作是在didSelectRowAtIndexPath方法 我會寫didSelectRowAtIndexPath方法的身體accessoryButtonTappedForRowWithIndexPath方法,但它不會工作。
現在,如果我評論cell.accessoryView = ACC;在上面的代碼中。它會正常工作。但我無法從附件按鈕中刪除圖像
我該如何擺脫它。
任何幫助將高度讚賞
感謝