开发者

Scaling UILabel text with the parent view

I have a UILabel that is a subview of a larger UIView. Is there a way to keep the 开发者_运维知识库text inside the UILabel proportional to the parent UIView so that when the parent changes size, either smaller or larger, the font size for the text in the UILabel will grow and shrink proportionally?


I think there is no easy way but to calculate how much the parent view went bigger or smaller and taking that quantity making the font smaller or larger. For example if the parent view is smaller by 50 pixels wide then making the font 5 pts smaller. Hope it's helpful

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜