views:

143

answers:

2

Hi all,

I have a UITableView and I have layout some labels for its rows. When the values change in the table (means text values changes inside the labels), I need to animate the UILabel's backgroundcolor( eg. Background color from red --> its original background color). Then users can clearly notice the values changed.

As far as I understand there are 2 parts.

  1. Detecting the text change event.
  2. Do the animation for some time duration.

Can someone please tell me how to do this? Thanks.

A: 

Refer to this:UITableView Example

cooltechnomax
Sorry cooltechnomax, I didn't find anything useful regrading my question. :-(
charith
So, can you clarify what you intend to do? You want to change the color of text in cells of a table when the values change. And you need this effect for some duration and back to black color, right?
cooltechnomax
Try to explore:reloadRowsAtIndexPaths:withRowAnimation: method of UITableView. You won't get a color change animation, but you can certainly include default UITableViewRowAnimations.
cooltechnomax
A: 

@property(nonatomic, copy) NSString *text;

This property's setter can be overwritten as following.

- (void)setText:(NSString *)value
{
   ///< copy this value to a member variable

   ///< send a notification about the text of UILabel was changed.
}

About the animation effect, maybe you can see the QuartzCore framework. It is useful for custom animation effect with CALayer class.

Toro