0

是否可以将 UIButtonTypeDetailDisclose 的图像从默认图像更改为更有趣的图像。但是,请注意我要求的是按钮,而不是一种类型的 uibutton。

4

1 回答 1

1

您将不得不更改单元格的附件视图。

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath

// code for initializing the cell..

UIImage *image = [UIImage imageNamed:@"interestingImage.png"];
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
CGRect frame = CGRectMake(44.0, 44.0, image.size.width, image.size.height);
button.frame = frame;
[button setBackgroundImage:image forState:UIControlStateNormal];

[button addTarget:self action:@selector(accessoryButtonTapped:)  forControlEvents:UIControlEventTouchUpInside];
button.backgroundColor = [UIColor clearColor];
cell.accessoryView = button;

return cell;
}
于 2013-05-14T13:39:44.343 回答