PDA

View Full Version : Animation inside of a UITableView record




KarlJay
Sep 4, 2012, 09:00 AM
I'm setting up a UITableView similar to Apple's Recipes sample project. I'd like to have either an animated graphic and/or to update the text on the record.

Think of the image or text as a clock or alarm timer.

One idea is to set a timer, call an update method that changes the pic and text, then refresh all the displayed records.

I think I can make that work, but don't know if it's the best approach.

Is there a way to have an updating text/pic in the records or does this require writing custom code?

Imagine the Recipes having a clock animation or timer where the food icon is, that's what I'm after.



PhoneyDeveloper
Sep 4, 2012, 05:59 PM
UIImageView can animate through an array of images. This is probably the simplest way to do a clock animation.

MattInOz
Sep 4, 2012, 06:54 PM
Also it's probably time to look at custom subclass of UITableViewCell.

The cell should be able to animate on its own without updating the table.

Duncan C
Sep 4, 2012, 07:15 PM
I'm setting up a UITableView similar to Apple's Recipes sample project. I'd like to have either an animated graphic and/or to update the text on the record.

Think of the image or text as a clock or alarm timer.

One idea is to set a timer, call an update method that changes the pic and text, then refresh all the displayed records.

I think I can make that work, but don't know if it's the best approach.

Is there a way to have an updating text/pic in the records or does this require writing custom code?

Imagine the Recipes having a clock animation or timer where the food icon is, that's what I'm after.

Do you want clock hands that spin continuously to indicate that something time-consuming is going on, or do you want to draw a graphical clock face that actually shows time of day, elapsed time, or time remaining.

If what you want is spinning clock hands that have no relation to the amount of time passing, I agree with the other poster that a UIImageView animation is the way to go.

If you want clock hands that actually show a meaningful time indicator of some sort, you're going to have to write some fairly complex Core Animation code.

KarlJay
Sep 4, 2012, 09:05 PM
Do you want clock hands that spin continuously to indicate that something time-consuming is going on, or do you want to draw a graphical clock face that actually shows time of day, elapsed time, or time remaining.

If what you want is spinning clock hands that have no relation to the amount of time passing, I agree with the other poster that a UIImageView animation is the way to go.

If you want clock hands that actually show a meaningful time indicator of some sort, you're going to have to write some fairly complex Core Animation code.
I'm looking at the second one: a graphical clock face that actually shows time of day, elapsed time, or time remaining.
Think of 6 alarms/timers that are for different events, basically the stock timer app is for one timer, this would be for several.
Similar in functionality to this (I don't know if he's got animations or not, the icons all look the same ): http://itunes.apple.com/us/app/multitimer-unlimited-countdowns/id365358824?mt=8

Duncan C
Sep 5, 2012, 09:06 PM
I'm looking at the second one: a graphical clock face that actually shows time of day, elapsed time, or time remaining.
Think of 6 alarms/timers that are for different events, basically the stock timer app is for one timer, this would be for several.
Similar in functionality to this (I don't know if he's got animations or not, the icons all look the same ): http://itunes.apple.com/us/app/multitimer-unlimited-countdowns/id365358824?mt=8

I'd probably create a custom control that did this, using Core Graphics, or maybe UIBezierPath objects. It would have a setting for the type of display (count down timer, clock, stopwatch) and take either a time interval or an NSDate, and draw itself based on the setting. I'd then set up a timer that broadcast a notification periodically, and all the clock controls would update themselves when they received that notification.