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
謝謝,這有助於很多 –