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 :
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 :
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.
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.
© 2022 - 2024 — McMap. All rights reserved.