Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone how to I make a uitableviewcellaccessorydisclosureindicator background transparent?

Can someone please explain to me how I can make a uitableviewcellaccessorydisclosureindicator's background in a UITableViewCell transparent?

Right now I'm facing this problem:

alt text http://www.bubl3r.com/disclosure.jpg

like image 721
dpigera Avatar asked Dec 17 '22 22:12

dpigera


1 Answers

Just found the answer. Turns out it was just 3 lines & having to define my own disclosure indicator .png image with a transparent background:

UITableViewCell *bgView = [[UITableViewCell alloc] initWithFrame:CGRectZero];
    bgView.backgroundColor=indexPath.row % 2? [UIColor colorWithRed:0.95 green:0.95 blue:0.95 alpha:1]: [UIColor whiteColor];
    bgView.accessoryView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"disclosure.png"]];
    cell.backgroundView=bgView; 


    return cell;
like image 134
dpigera Avatar answered Dec 28 '22 08:12

dpigera