Skip to content

Instantly share code, notes, and snippets.

@amitpdev
Created May 16, 2013 16:26
Show Gist options
  • Save amitpdev/5593016 to your computer and use it in GitHub Desktop.
Save amitpdev/5593016 to your computer and use it in GitHub Desktop.
UIButton with custom image in place of UITable's accessoryView ( right arrow > )
// Add a MAP button in place of the cell's accessoryView
UIImage *image = [UIImage imageNamed:@"checkin-fb-place.png"];
UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
UIButton *mapButton = [[UIButton alloc] initWithFrame:imageView.frame];
[mapButton setImage:image
forState:UIControlStateNormal ];
[mapButton addTarget:self action:@selector(mapAction:)
forControlEvents:UIControlEventTouchDown];
cell.accessoryView = mapButton;
[imageView release];
[mapButton release];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment