iphone - Graphics and Animation: Numbers changing and colored bar -


i want animate attached screen in such way when screen appear on screen:

1) numbers animate 0 final value i.e. 1-2-3-....51-52

2) each bar begin thin line , grow side until respected size.

3) animations happen simultaneously.

4) if possible, how can add shadow below bar?

5) how can implement bar (graphically)? there example?

enter image description here

for bars use simple uiview instances. after importing <quartzcore/quartzcore.h> can give them border , shadow via layer (view.layer). see calayer: https://developer.apple.com/library/ios/#documentation/graphicsimaging/reference/calayer_class/introduction/introduction.html

borderwidth, bordercolor, backgroundcolor  shadowopacity, shadowradius, shadowoffset, shadowcolor, shadowpath 

for animations of numbers, use timer , increase numbers until actual value reached. smth. this:

cgfloat animationduration = 1.0; self.targetvalue = 50; [nstimer scheduledtimerwithtimeinterval:animationduration/targetvalue target:self selector:@selector(increasevalue:) userinfo:nil repeats:yes]; 

and method this:

- (void)increasevalue:(nstimer*)timer; {     self.label.text = [nsstring stringwithformat: @"%d", [self.label.text intvalue]+1];      if ([self.label.text intvalue] == self.targetvalue) {         [timer invalidate];     } } 

for animation, resize frames:

[uiview animatewithduration:animationduration animations:^{     cgrect rect = self.barview.frame;     rect.size.width = self.targetvalue;     self.barview.frame = rect; }]; 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -