I need to change the color of the disclosureIndicatorView
accessory in a UITableViewCell
.
I think there are two ways to get this done, but I'm not able to figure out which one's the optimum. So here is what I think I can do.
There is a property of UITableViewCell
- accessoryView
. So I can use setAccessoryView:(UIView *)view
and pass view as the UIImageView
holding the image that I want.
I have written an utility class which creates the content view (stuff like background color, adding other stuff, etc) for my cell and I add this content view to the cell in UITableViewDelegate
. The other option is to draw a UIImage
overriding the drawRect
method of CustomContentView
utility class.
Performing option 1 - I can get the things done the apple way. Just give them the view and they do the rest. But I guess adding a new UIView
object to every row might turn out to be a heavy object allocation and decreasing the frame rate. As compared to just a UIImage
object in my contentView
. I believe UIImage
is lighter than UIView
.
Please throw some light people and help me decide over it.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…