gpt4 book ai didi

ios - superview.superview 上的透明 UILabel textColor(有点)

转载 作者:技术小花猫 更新时间:2023-10-29 10:38:10 25 4
gpt4 key购买 nike

我想为我的 UILabel 实现与 iOS 7 的新 iTunes 远程更新相同的效果。

如果您查看此屏幕:

http://313e5987718b346aaf83-f5e825270f29a84f7881423410384342.r78.cf1.rackcdn.com/1383617182-2013-11-05_03.05.58_04.png

(右边的那个)你会注意到 UILabel 文本颜色是背景模糊的专辑封面,没有黑色 mask 。

目前我有透明的 UILabel textColor ( http://cl.ly/SInK ),我的代码类似于 https://github.com/robinsenior/RSMaskedLabel

我的第一个假设是拥有这样的 View 层次结构

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)。

我想不出一个解决方案来实现这种效果。

最佳答案

自 iOS 8 以来,Apple 提供了一个新类 UIVibrancyEffect,可以将其添加到 UIVisualEffectView。这与 UIBlurEffect 结合可以实现与我上面的屏幕截图完全相同的结果。

来源:https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIVibrancyEffect/index.html

关于ios - superview.superview 上的透明 UILabel textColor(有点),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19787238/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com