开发者

Easy way to blur label

开发者 https://www.devze.com 2022-12-27 18:14 出处:网络
Need to create blurred shadow under UILabel. Same text but with blur and offset. Since NSShadow not supported in the iPhone SDK only way I see is Quartz render. Is there simpliest solution ?

Need to create blurred shadow under UILabel. Same text but with blur and offset. Since NSShadow not supported in the iPhone SDK only way I see is Quartz render. Is there simpliest solution ? 开发者_开发技巧Thanks


I provide code to draw a shadow around a UILabel in my answer to this question. For an example of this in action, see the sample project I've created. A shadow of the same color as the text provides a nice blurring effect to the text in a label.


For 3.1 and below, no. You must use CoreGraphics.

For 3.2 and above, you can get the layer, and set the shadowRadius property.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号