UIViewAnimationOptionAllowUserInteraction
是用块动画视图的选项之一。允许用户在动画时与视图交互。
enum {
UIViewAnimationOptionLayoutSubviews = 1 << 0,
UIViewAnimationOptionAllowUserInteraction = 1 << 1,
UIViewAnimationOptionBeginFromCurrentState = 1 << 2,
UIViewAnimationOptionRepeat = 1 << 3,
UIViewAnimationOptionAutoreverse = 1 << 4,
UIViewAnimationOptionOverrideInheritedDuration = 1 << 5,
UIViewAnimationOptionOverrideInheritedCurve = 1 << 6,
UIViewAnimationOptionAllowAnimatedContent = 1 << 7,
UIViewAnimationOptionShowHideTransitionViews = 1 << 8,
UIViewAnimationOptionCurveEaseInOut = 0 << 16,
UIViewAnimationOptionCurveEaseIn = 1 << 16,
UIViewAnimationOptionCurveEaseOut = 2 << 16,
UIViewAnimationOptionCurveLinear = 3 << 16,
UIViewAnimationOptionTransitionNone = 0 << 20,
UIViewAnimationOptionTransitionFlipFromLeft = 1 << 20,
UIViewAnimationOptionTransitionFlipFromRight = 2 << 20,
UIViewAnimationOptionTransitionCurlUp = 3 << 20,
UIViewAnimationOptionTransitionCurlDown = 4 << 20,
UIViewAnimationOptionTransitionCrossDissolve = 5 << 20,
UIViewAnimationOptionTransitionFlipFromTop = 6 << 20,
UIViewAnimationOptionTransitionFlipFromBottom = 7 << 20,
};
typedef NSUInteger UIViewAnimationOptions;
但我不知道它是如何帮助您使用UIActivityIndicatorView。简单的例子:
[UIView animateWithDuration:0.4f
delay:0.2f
options:UIViewAnimationOptionAllowUserInteraction | UIViewAnimationOptionCurveEaseInOut
animations:^{
[myView setFrame:CGRectOffset(view.frame, 0, -100)];
}
completion:^(BOOL finished){
NSLog(@"completed");
}
];
当使用'UIActivityIndicatorView'时,我通常会创建空的持有者视图,将它放在前面并放入它UIActivityIndicatorView。当进程完成时,只需删除此视图 – beryllium
谢谢,这有助于很多 –