Drawing selected state on custom UITableViewCell

Posted by Brian on Stack Overflow See other posts from Stack Overflow or by Brian
Published on 2010-04-10T12:47:02Z Indexed on 2010/04/10 12:53 UTC
Read the original article Hit count: 537

So I have a customer UITableViewCell whose whole display in drawn in drawRect. When it draws it creates CGLayers so that it can reuse certain pieces when something is changed. I have changed my UITableViewCellSelectionStyle to None because I don't want the default selected view to cover my drawing. So I call setNeedsDisplay in setSelected:animated: for my cell. But by the time drawRect is called, setSelected:animated: has already been called again to deselect the cell. In my table view controller in didSelectRowAtIndexPath I call deselectRowAtIndexPath as Apple advises. Any ideas? Thanks.

© Stack Overflow or respective owner

Related posts about uikit

Related posts about uitableviewcell