I am having one query. I googled it alot but not able to find out its solution.
I am using one api in which I am getting content as HTML string.
Now I want to set that data to UITextView. Now to calculate the height of the UITextView firstly I was using
CGSize constraint = CGSizeMake(width-MARGIN - (6 * 2), 20000.0f);
// Get the size of the text given the CGSize we just made as a constraint
CGSize size = [lbltitle.text sizeWithFont:[UIFont fontWithName:custom_font_name size:lbltitle.font.pointSize] constrainedToSize:constraint lineBreakMode:NSLineBreakByWordWrapping];
int lines = size.height / lbltitle.font.pointSize + 1;
[lbltitle setFrame: CGRectMake(lbltitle.frame.origin.x,lbltitle.frame.origin.y,width-MARGIN, lbltitle.font.pointSize * lines)];
but now when I am passing the html content it's generating the height more then the needed. So what is the solution to calculate the height of the UITextview with HTML text. I am using below code to assign HTML text to UITextView.
[txtdescription setValue:data.desc forKey:@"contentToHTMLString"];
Thanks in advance.