-(float)getLabelHeight:(NSString *)str andFont:(CGFloat )font andWidth:(float)width
{
if ([[[ UIDevice currentDevice ] systemVersion ] floatValue ] < 7 ) // Adaptive before ios 7
{
// UIFont *font = [UIFont systemFontOfSize:font];
CGSize maxSize=CGSizeMake(width, MAXFLOAT);
CGSize size = [str sizeWithFont:[UIFont systemFontOfSize:font] constrainedToSize:maxSize lineBreakMode:UILineBreakModeWordWrap];
return size.height;
}
else
{
NSDictionary *dic=@{ NSFontAttributeName:[UIFont systemFontOfSize:font]};
CGSize maxSize=CGSizeMake(width, MAXFLOAT);
CGRect rect=[str boundingRectWithSize:maxSize options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil];
return rect.size.height;
}
}