Adding a UIView to a UITableViewCell via cell.contentView

Posted by Robert Eisinger on Stack Overflow See other posts from Stack Overflow or by Robert Eisinger
Published on 2011-01-02T00:52:00Z Indexed on 2011/01/02 0:53 UTC
Read the original article Hit count: 168

I have a class called GraphView that extends UIView that basically draws a small little line chart. I need one of these graphs at the top of each section in my UITableView. So I tried by creating a separate cell at the top of one of my sections and then on that cell I did:

[cell.contentView addSubview:graphView];
[graphView release];

But when I scroll down, it's like the graph is glitchy and it shows up in random spots along the UITableView. Anyone have ideas or insight? Is there a better way to incorporate another UIView into the top of each section in my UITableView?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uitableview