-2
我有一個觀點,我想用一個模糊來遮擋它,並讓它具有動畫效果。我在故事板中添加了名爲blurField的UIVisualEffectView。這是我一起入侵的,有沒有更乾淨的方法來做到這一點?謝謝!如何讓UIVisualEffectView淡入動畫?
-(void)viewDidLoad {
[super viewDidLoad];
self.blurField.alpha = 0.0;
[self performSelector:@selector(fillInBlur) withObject:nil afterDelay:3.0];
}
-(void)fillInBlur {
self.blurField.alpha = 0.1;
[self performSelector:@selector(fillInBlur1) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur1 {
self.blurField.alpha = 0.2;
[self performSelector:@selector(fillInBlur2) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur2 {
self.blurField.alpha = 0.3;
[self performSelector:@selector(fillInBlur3) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur3 {
self.blurField.alpha = 0.4;
[self performSelector:@selector(fillInBlur4) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur4 {
self.blurField.alpha = 0.5;
[self performSelector:@selector(fillInBlur5) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur5 {
self.blurField.alpha = 0.6;
[self performSelector:@selector(fillInBlur6) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur6 {
self.blurField.alpha = 0.7;
[self performSelector:@selector(fillInBlur7) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur7 {
self.blurField.alpha = 0.8;
[self performSelector:@selector(fillInBlur8) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur8 {
self.blurField.alpha = 0.9;
[self performSelector:@selector(fillInBlur9) withObject:nil afterDelay:0.03];
}
-(void)fillInBlur9 {
self.blurField.alpha = 1.0;
}
感謝您的幫助@matt! – tahoecoop