-2

my UIView has a UILabel and a UIWebView inside, the UILabel is in the top, the UILabel has the height variable:

theTitle.text = [NSString stringWithFormat:@"%@", noticeTitle];
theTitle.lineBreakMode = UILineBreakModeWordWrap;
theTitle.numberOfLines = 0;
[theTitle sizeToFit];

how can I start the UIWebView below the UILabel?

Thank you in advance.

Regards.

user1256477
  • 10,763
  • 7
  • 38
  • 62

1 Answers1

0

I think you want your webView to be displayed just below the label.If the string you want to display is dynamic then your Label size must also be dynamically set according to the string size. So for adjusting your label size Just follow the link :

Adjust UILabel height depending on the text

And then you can get the height of your label by :

 int height = theTitle.frame.size.height;

You then set your webView frame according to this height + yValue of label frame.

Community
  • 1
  • 1
AJS
  • 1,403
  • 12
  • 17