How can I customize the accessory disclosure image in a UITableViewCell?

前端 未结 9 603
被撕碎了的回忆
被撕碎了的回忆 2020-12-07 15:55

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

9条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-07 16:20

    I'd do it as follows:

    UIImageView *chevronImgVw = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"chevron_accessory_vw_img.png"]];
    chevronImgVw.frame = CGRectMake(cell.accessoryView.frame.origin.x, cell.accessoryView.frame.origin.y, 10, 20);
    cell.accessoryView = chevronImgVw;
    

    Please, try out this before you down vote! Because at the moment it has 2 upvotes and 2 downvotes!

提交回复
热议问题