Abbiamo integrato con successo UIVibrancyEffect e UIVisualEffectView nella nostra app, ma sto notando che la vivacità non è così intensa come vorrei e il testo è più debole delle demo che ho 'ho visto. Non riesco a trovare alcun modo per modificare questo, o per influenzarlo in alcun modo. Ho pensato che potrebbe essere perché stiamo usando un font personalizzato, ma l'ho provato anche io e il font è più spesso ma sembra ancora debole. Qualche idea?La sottoview UIVibrancyEffect UIVisualEffectView non è abbastanza vivace
Con la nostra carattere personalizzato Aperto Sans Light:
con font di sistema:
Ecco il codice:
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
[blurEffectView setFrame:self.viewController.view.bounds];
UIVisualEffect *vibrancyEffect = [UIVibrancyEffect effectForBlurEffect:blurEffect];
UIVisualEffectView *vibrancyEffectView = [[UIVisualEffectView alloc] initWithEffect:vibrancyEffect];
[vibrancyEffectView setFrame:self.viewController.view.bounds];
[blurEffectView.contentView addSubview:vibrancyEffectView];
UITextView *messageText = [[UITextView alloc] initWithFrame:CGRectMake(0,0,320,568)];
[messageText setFont:[CLAppearanceManager fontForLabelType:CLAppearanceLabelFontWaveMessageEntry]];
[messageText setTextColor:[UIColor whiteColor]];
messageText.layer.shadowColor = [[UIColor blackColor] CGColor];
messageText.layer.shadowOffset = CGSizeMake(1.0,1.0);
messageText.layer.shadowRadius = 3.0;
[messageText setBackgroundColor:[UIColor clearColor]];
if(self.messageLabel.text && self.messageLabel.text.length>0) {
[messageText setText:self.messageLabel.text];
} else {
[messageText setText:@"no message"];
}
[messageText setTextAlignment:NSTextAlignmentCenter];
[messageText setEditable:NO];
[messageText addObserver:self forKeyPath:@"contentSize" options:(NSKeyValueObservingOptionNew) context:NULL];
self.bigMessageText = messageText;
[vibrancyEffectView.contentView addSubview:messageText];
self.blurView = blurEffectView;
UITapGestureRecognizer *dismiss = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeBlurView)];
[self.blurView addGestureRecognizer:dismiss];
[self.viewController.view addSubview:self.blurView];
[self.class centerContentForTextView:messageText];
[self.blurView setAlpha:0.0];
[UIView animateWithDuration:0.2 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:0.5 options:UIViewAnimationOptionCurveEaseIn animations:^{
[self.blurView setAlpha:1.0];
} completion:nil
}];
Per ulteriori dettagli su come si imposta la gerarchia delle viste, in particolare la vista effetto sfocato e la vista effetto vibranco. –