我正在尝试模糊我以编程方式创建的标签文本,我已经能够应用模糊,但只能应用于标签本身,使文本可读并且只模糊标签背后的背景。 / p>
有没有办法只模糊文字?
提前致谢。
修改
直到现在我的代码:
UILabel *lblVericalName =
[[UILabel alloc]initWithFrame:CGRectMake(-95,
_viewVerticalStick.frame.size.height-120,
200,
20)];
lblVericalName.tag = [tarefaDiaArray.idTarefaDia integerValue];
lblVericalName.text = tarefaDiaArray.nomeTarefa;
lblVericalName.transform=CGAffineTransformMakeRotation( M_PI+89.55 );
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *blurEffectView =
[[UIVisualEffectView alloc] initWithEffect:blurEffect];
blurEffectView.frame = lblVericalName.bounds;
blurEffectView.autoresizingMask =
UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[viewStickBackground addSubview:lblVericalName];
if ([tarefaDiaArray.tarefaPremium intValue] ==1) {
//[viewStickBackground addSubview:blurEffectView];
[lblVericalName addSubview:blurEffectView];
}
编辑2:
更新
我已经取得了一些进展,现在我有了这个:
我需要让它看起来像这样:
这是我正在使用的代码:
lblNomeVertical.textColor = [UIColor colorWithRed:0.494 green:0.494 blue:0.494 alpha:0.8];
lblNomeVertical.layer.shadowOffset = CGSizeMake(1, 1.1);
lblNomeVertical.layer.shadowColor = [UIColor colorWithRed:0.827 green:0.827 blue:0.827 alpha:1].CGColor;
lblNomeVertical.layer.shadowRadius = 1.0;
lblNomeVertical.layer.shadowOpacity = 1;