tags:

views:

19

answers:

1

hi i have a problem with the selection when I select a row in uitableviewcell it selects and turns to blue with out making any animation i mean normally when a row in table is selected it turns into blue and go off immediately like an animation. How to achieve that? Not deslecting a row....it is like highlight the cell and go off when cell is selected by user...Can any one help please....

A: 

From the Table View Programming Guide, Responding to Selections:

In your tableView:didSelectRowAtIndexPath: method add the following:

[tableView deselectRowAtIndexPath:indexPath animated:NO];

"Selecting" does the blue-highlight animation, "deselecting" flashes it back to normal color. By adding a deselection as soon as it's selected you get the effect of flashing it with color.

If you want to avoid the whole coloring thing, you can use UITableViewCellSelectionStyleNone as your cell style.

Ben S
thank you ....that works absolutely fine....
Mano
One more thing I need to make a check mark next to the cell row selected . I mean when I click on a row of particular table it navigates to next page where he can select his own row and it displays his selection as check mark at the end of cell . How to achieve this ...Please help me I am trying this from long time I cannot figure it out...Thank you inadvance...
Mano
http://developer.apple.com/iphone/library/documentation/userexperience/conceptual/TableView_iPhone/ManageSelections/ManageSelections.html#//apple_ref/doc/uid/TP40007451-CH9-SW7 If your selection can only be one cell, look at Listing 6-3. If your selection can be more than one list, look at Listing 6-4.
Ben S