开发者

how make a selection glow and then off in uitableviewcell

开发者 https://www.devze.com 2023-01-04 07:47 出处:网络
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开发者_JAVA技巧 mean normally when a row in table is selected

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开发者_JAVA技巧 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....


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消