我经常搜索,但无法在互联网上找到这样的控件。 你能帮助我自己做这件事吗?
答案 0 :(得分:0)
拍摄上面图像中显示的白色圆圈图像,然后尝试下面的代码。
- (void)startSpin
{
if (!animating)
{
animating = YES;
[self spinWithOptions: UIViewAnimationOptionCurveEaseIn];
}
}
- (void)spinWithOptions:(UIViewAnimationOptions) options
{
[UIView animateWithDuration: 1.0f
delay: 0.0f
options: options
animations: ^{
imgViewCircle.transform = CGAffineTransformRotate(imgViewCircle.transform, M_PI / 2);
}
completion: ^(BOOL finished) {
if (finished) {
if (animating) {
// if flag still set, keep spinning with constant speed
[self spinWithOptions: UIViewAnimationOptionCurveLinear];
} else if (options != UIViewAnimationOptionCurveEaseOut) {
// one last spin, with deceleration
[self spinWithOptions: UIViewAnimationOptionCurveEaseOut];
}
}
}];
}