Sheehan Alam
Sheehan Alam

Reputation: 60909

How can I split a UITableViewCell?

I would like to achieve a UITableViewCell to look like this image (following/tweets/etc):

alt text http://etch-reviews.com/wp-content/uploads/2009/10/tweetie-2-profile-screen.jpg

Upvotes: 1

Views: 1229

Answers (3)

Fabiano Francesconi
Fabiano Francesconi

Reputation: 1780

What happens if you use such approach (using CoreGraphics) and then you tap the cell? Will it be colored totally in blue or just the slice you are touching?

Because that's the problem, and that's not even a button.

Upvotes: 0

RunLoop
RunLoop

Reputation: 20376

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.

Upvotes: 0

rpetrich
rpetrich

Reputation: 32336

Use CoreGraphics to draw the text and divide lines manually in a UITableViewCell subclass

(this is all Twitter for iPhone does)

Upvotes: 1

Related Questions