Animation like Radar Objective C
Asked Answered
V

2

6

How i can do a UIView animation like a radar? I already have a UIView with the circles created with drawrect, but how i can create a line, doing a clock animation?

Like the image below : enter image description here

Viable answered 18/3, 2013 at 17:45 Comment(0)
V
6

If you are already having all these images then you only require one radar line animation.

You can rotate radar line using this code:

- (void) startAnimation {

CABasicAnimation *radarHand;

radarHand = [CABasicAnimation animationWithKeyPath:@"transform.rotation"];

radarHand.fromValue = [NSNumber numberWithFloat:fromAngle+M_PI];

radarHand.byValue = [NSNumber numberWithFloat:((360*M_PI)/180)];

radarHand.duration = 60.0f;

radarHand.repeatCount = HUGE_VALF;

}

(Guess radar line - semi transparent image is also there with you.)

Hope this will help you.

Vargas answered 18/3, 2013 at 18:1 Comment(1)
How can i use itIlario
W
0

You can create UIView with size of this circle and with center at the center of the circle, draw line (that starts from the center of this view) and than rotate this view.

Weismann answered 18/3, 2013 at 18:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.