I would like to achieve a UITableViewCell to look like this image (following/tweets/etc):
A:
Use CoreGraphics to draw the text and divide lines manually in a UITableViewCell
subclass
(this is all Twitter for iPhone does)
rpetrich
2010-07-24 06:32:24
I'm not familiar with CoreGraphics. Can you show me an example?
Sheehan Alam
2010-07-24 06:35:32
Override `drawRect:`. Call `UIGraphicsGetCurrentContext` to get the current graphics context. Call `CGContextSetStrokeColorWithColor` to set the stroke color. Use `CGContextMoveToPoint` and `CGContextAddLineToPoint` to set a path. Use `CGContextStrokePath` to stroke the path.
rpetrich
2010-07-24 07:04:42
A:
A simpler solution would be to just add 5 subviews to the contentview of the cell in cellforrow, being 4 uitextfields and 1 uiview (the horizontal line). However, this will only be suitable for a tableview with a small number of rows as above as scrolling may suffer for long tables unless rpetrich's drawrect solution is adopted.
Run Loop
2010-07-24 19:14:38