PDA

View Full Version : Showing selected cell in a table view, like in YouTube




drivefast
Dec 11, 2008, 12:44 AM
hi everybody. i'm struggling to obtain the same effect as in the youtube app when a table's cell is tapped. what youtube seems to be doing is showing the selection on the cell (blue background) as soon as the finger is lifted from the screen. what naturally happens with the sdk is to select the cell (paint its background blue) when the finger lands on the screen. also, with the sdk there seems to be a delay between the moment the screen is touched and the moment the cell gets selected - not much, but noticeable.

so what i need to do is in fact showing the cell's "selected" background when the finger is removed from the cell, rather than when the finger lands on the cell. i tried using UITableViewCellSelectionStyleNone on the cell when created, then changing it to UITableViewCellSelectionStyleBlue in the didSelectRowAtIndexPath event and immediately select the cell from code after that. but the same didSelectRowAtIndexPath event launches a transition animation that hides the view containing the table, and the cell doesnt seem to have enough time to update itself. any other ideas? thanks.