-1

I need to move the one image around other image where both images are in circle shape,they should not collide or overlap with each other. I tried with CGRectIntersectsRect but no use of it because of corner radius of image i.e intersect function get called before they collide. enter image description here enter image description here

4

1 回答 1

0

您可以使用动画来执行此操作,但为此您应该将其作为单个图像,如第一张图像所示,并制作具有不同位置的蓝色图像在圆圈中的不同图像。

loadingImageView.animationImages = [[NSArray alloc]initWithObjects:[UIImage imageNamed:@"circle1.png"],[UIImage imageNamed:@"circle2.png"],[UIImage imageNamed:@"circle3.png"],[UIImage imageNamed:@"circle4.png"],[UIImage imageNamed:@"circle5.png"],[UIImage imageNamed:@"circle6.png"],[UIImage imageNamed:@"circle7.png"],[UIImage imageNamed:@"circle8.png"],[UIImage imageNamed:@"circle9.png"],[UIImage imageNamed:@"circle10.png"],[UIImage imageNamed:@"circle11.png"],[UIImage imageNamed:@"circle12.png"],[UIImage imageNamed:@"circle13.png"], nil];

if(![loadingImageView isAnimating])
{
    loadingImageView.animationDuration=4;
    [loadingImageView startAnimating];

}

circle1.png,circle2.png,circle3.png...等是包含蓝色和红色图像作为一个图像的图像,蓝色图像在圆圈中的不同位置。现在希望对您有所帮助。如果有任何问题,请告诉我。

于 2012-11-26T11:46:30.283 回答