iPhone - 自定义雪佛龙图标

时间:2009-10-27 03:35:00

标签: iphone cocoa-touch

是否可以使用自定义图标替换UITableViewCellAccessoryDetailDisclosureButton的图标?

2 个答案:

答案 0 :(得分:2)

不确定。将accessoryView设置为自定义图像视图。

答案 1 :(得分:1)

在viewForAnnotation中使用它:

UIButton *advertButton = [UIButton buttonWithType:UIButtonTypeCustom];
advertButton.frame = CGRectMake(0, 0, 23, 23);
advertButton.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
advertButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;

[advertButton setImage:[UIImage imageNamed:@"button-image.png"] forState:UIControlStateNormal];
[advertButton addTarget:self action:@selector(advertFunction:) forControlEvents:UIControlEventTouchUpInside];

annView.rightCalloutAccessoryView = advertButton;

不要忘记在您的应用中包含图片以及指定选择器的功能。