开发者

Use SizeToFit() on a UILabel with a shadow?

I am having some UILabel elements for which a dynamically alter the text. I also add shadows to the labels using label.Layer.ShadowOffset and dito color.

When the text of a label has been changed I use SizeToFit. Problem: That method do开发者_开发技巧es not take into account the shadows - which leads to labels that are too small and the shadows are cut of.

Is there an easy way to fix this, or do I have to manually alter the size after the SizeToFit call?


Why are you setting the shadow on the layer, instead of using UILabel's shadowOffset and shadowColor properties? I would expect sizeToFit to account for the shadow in that case.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜