//1. 限定的寬度和lable 的寬度不一致
//2. 計算時使用的字體及字號與lable 顯示時使用的字體和字號不一致
NSDictionary * dic = [NSDictionary dictionaryWithObjectsAndKeys:[UIFont systemFontOfSize:12], NSFontAttributeName, nil];
//第一個參數: 寬度 和 lable 一樣, 高度要麼不設(爲0), 要麼就足夠大,否則都會導致計算錯誤
//第二個參數: 是從原點開始繪製
//第三個參數: 是文本繪製所需的屬性,如 :字號 等
CGRect rect = [str boundingRectWithSize:CGSizeMake(280, 0) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:dic context:nil];
//NSLog(@"%@", NSStringFromCGRect(rect));
aLable.frame = CGRectMake(aLable.frame.origin.x , aLable.frame.origin.y, aLable.frame.size.width, rect.size.height);
CGSize rect = [lab sizeWithFont:[UIFont systemFontOfSize:12] constrainedToSize:CGSizeMake(280,2000) lineBreakMode:NSLineBreakByTruncatingHead];