I would like to use a custom version of the standard disclosure accessory image in my UITableView. How can I do this? I\'m hoping that sub-classing UITableViewCell is not ne
There is a nice example from Apple showing how to use UIControl
to fulfill this kind of accessoryView customisation.
Overriding - (void)drawRect:(CGRect)rect
in UIControl is not the easiest way, but gives you lots of flexibility to style nice accessory views.
- (UITableViewCell *)tableView:(UITableView *)tView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UIImage *indicatorImage = [UIImage imageNamed:@"Arrow.png"];
cell.accessoryView =[[[UIImageView alloc] initWithImage:indicatorImage] autorelease];
return cell;
}
well i do this with the help code given above
You'll need to create a custom view and assign it to the accessoryView
property of the UITableViewCell
object. Something like:
myCell.accessoryView = [[ UIImageView alloc ]
initWithImage:[UIImage imageNamed:@"Something" ]];