【发布时间】:2016-02-15 10:33:24
【问题描述】:
我正在尝试模糊我以编程方式创建的标签的文本,我已经能够应用模糊,但仅限于标签本身,使文本可读并且仅模糊标签后面的背景。
有没有办法只模糊文字?
提前致谢。
编辑:
这是我现在的代码:
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;
【问题讨论】:
-
你还没有展示你实际在做什么。显示它。
-
请解释您当前的代码做了什么以及为什么它不能满足您的要求。
-
@SuperBiasedMan 我已经添加了发生的事情的图像。我需要使文本模糊(散焦),但不是所有标签
标签: ios objective-c text uilabel blur