UILabel Dynamic height problem
I have one UILabel
and one button under the label. Height of the label is dynamic. I use this: [label sizeToFit];
But开发者_StackOverflow中文版 when the size of the label raise, it wrap the button. How can I rearrange the view ? Thanks in advance
How about something like this:
[label sizeToFit];
btn.frame = label.frame;
Thereby setting your button to the same size as the label... or manually adding some padding like this:
[label sizeToFit];
btn.frame = CGRectMake(label.frame.origin.x - 10, label.frame.origin.y - 10, label.frame.size.width + 20, label.frame.size.height + 20);
精彩评论