I have an application in which I am loading a UITableView
from 3 types custom cells
. I made 3 custom classes for that and added all the elements Progra
you can calculate height by using below function
-(CGSize)SizeOfString:(NSString *)string withFont:(UIFont *)font constrainedToWidth:(CGFloat)width
{
CGSize size = [string sizeWithFont:font constrainedToSize:CGSizeMake(width, 4000) lineBreakMode:UILineBreakModeWordWrap];
return CGSizeMake(width, size.height + 10);
}
Call
CGSize size = [self SizeOfString:your_text withFont:your_font constrainedToWidth:width_of_showing_area];