VisualEffetView のアニメーション化中に問題が発生しました。これが私が宣言するコードです。
UIBlurEffect* blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
effectView = [[UIVisualEffectView alloc] initWithEffect:blur];
effectView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
effectView.frame = self.bounds;
self.layer.borderWidth = 1;
[self addSubview:effectView];
スーパービューをアニメーション化して大きくすると、視覚効果はスーパービューのアニメーションに従いますが、縮小したい場合、視覚効果が即座に消えて非常に醜い結果になります^^ スーパービューをアニメーション化するコードは次のとおりです (ここではルシェルシュと呼びます)
[UIView animateWithDuration:0.3f
delay:0.0f
options:UIViewAnimationOptionTransitionNone
animations:^{
CGRect f = recherche.frame;
f.size.height = 0;
[recherche setFrame:f];
}
completion:^(BOOL finished){
[recherche removeFromSuperview];
recherche = nil;
}];
rechercheを消すとこんな感じ。UIBlurEffectStyleを変更すると色が変わるので白い四角がエフェクトビューのようです。ただし、ぼかし効果はありませんx)