views:

78

answers:

3

I'm trying to build a grouped UITableView cell like the table in user details in Twitter's app (former Tweetie app).

It's a cell with two sides, and you can select any of them separately (and the background turns blue, like a rounded button).

Anyone did something like it or know how they made it?

A screen shot from the view (it's the following, tweets, followers and favorites cells)

alt text

A: 

Use two UIButtons in your custom cell to make that.

MathieuF
+1  A: 

First off.... create a background image that is nothing but a white rectangle with a single grey line down the middle.

Next, subclass a UITableViewCell..... it has two custom style UIButtons. The background is the white image with the line down the middle from earlier.

assign clearColor to the button background image and button image.

Size and place buttons such that button1 and button 2 meet at the single grey line.

In your tableView where you plan to use this custom cell, make it a grouped style tableview.

Go crazy ^_^

Siddharth Iyer
Amazing, seems a good way to do that. I will try and back to say if it solved my problem. Thanks! :D
Ricardo Augusto
The topic starter wanted a solution in which both sides of the column could be highlighted in blue when pressed. Which your solution does not accomplish.
Yannick Compernol
I don't see what you mean. You can do whatever you want with a UIButton..... those are trivial details :) .... setting two UIButtons separately like I said accomplishes what he wants ....
Siddharth Iyer
@Ricardo: Yes... keep me posted if you are successful....
Siddharth Iyer
A: 

you can do anything you want in UITableViewCell class. then put it together inside the tableView and build and run men. the skies are the limits.

DevDreamers