透明UILabel textColor on superview.superview(sort of) [英] Transparent UILabel textColor on superview.superview (sort of)
问题描述
我想实现与iOS 7的新远程更新为 UILabel
相同的效果。
I would like to achieve the same effect as in the new iTunes remote update for iOS 7 for my UILabel
.
如果您查看此屏幕:
(右侧的一个),您会注意到 UILabel
文本颜色是没有黑色面具的背景模糊相册封面。
(The one on the right) you'll notice that the UILabel
text color is the background blurred album cover without the black mask.
目前我有透明 UILabel
textColor( http://cl.ly/SInK ),我的代码类似于 https://github.com/robinsenior/RSMaskedLabel
At the moment I have transparent UILabel
textColor (http://cl.ly/SInK), my code is similar to https://github.com/robinsenior/RSMaskedLabel
我的第一个假设是拥有像
My first assumption is to have a view hierarchy like that
UIImageView (Light blurred image)
|
UIImageView/UIView (Dark blurred image or just a dark mask for the superview)
|
UILabel (And all my other view).
我想让 UILabel
透明文本颜色在第一个UIImageView,忽略第二个/ Mask)。
I would like the UILabel
to have a transparent text color on the first UIImageView, ignoring the second one/Mask).
我无法围绕解决方案来实现这种效果。
I can't wrap my head around a solution to achieve this effect.
推荐答案
由于iOS 8苹果提供了一个新类UIVibrancyEffect,可以添加到UIVisualEffectView。这与UIBlurEffect结合可以实现与我上面的截图完全相同的结果。
Since iOS 8 Apple offer a new class, UIVibrancyEffect, which can be added to a UIVisualEffectView. This combined with a UIBlurEffect can achieve the exact same result as my screenshot above.
这篇关于透明UILabel textColor on superview.superview(sort of)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!