【发布时间】:2014-06-29 16:27:59
【问题描述】:
我正在尝试使 UIView (Genres) 背景模糊。我试过这段代码。但是太模糊了:
_Genres.opaque = NO;
_Genres.backgroundColor = [UIColor clearColor];
UIToolbar *fakeToolbar = [[UIToolbar alloc] initWithFrame:_Genres.bounds];
fakeToolbar.autoresizingMask = _Genres.autoresizingMask;
[_Genres insertSubview:fakeToolbar atIndex:0];
所以我尝试了这个:
_Genres.alpha = 0.9;
但这只是让它看不透而不是模糊。
UIView 还需要“实时模糊”。
这是两张图片。第一个是实际的工具栏(我希望它像),第二个是使用上面的代码。他们都被接管了相同的背景。
正如您在工具栏下方看到的那样,模糊程度要低得多。
如何让它更像原来的工具栏?
【问题讨论】:
-
你可以使用 CoreImage 来解决你的问题 Go for this here
标签: ios objective-c uiview