iOS7中Cell高度 Label高度自适应
2014-06-11 09:54
381 查看
- (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ NSString *str = [_dataArray objectAtIndex:indexPath.row]; UIFont *tfont = [UIFont systemFontOfSize:14.0]; NSDictionary * dic = [NSDictionary dictionaryWithObjectsAndKeys:tfont,NSFontAttributeName,nil]; // ios 7 CGSize sizeText = [str boundingRectWithSize:CGSizeMake(320, 1000) options:NSStringDrawingUsesLineFragmentOrigin attributes:dic context:nil].size; // ios 6 CGSize sizeText1 = [str sizeWithFont:[UIFont systemFontOfSize:16.0f] constrainedToSize:CGSizeMake(320, 1000) lineBreakMode:NSLineBreakByCharWrapping]; return sizeText1.height+50; }
相关文章推荐
- cell、label的自适应高度
- StoryBoard设置Cell中的Label自适应高度
- UITableViewCell高度自适应Label高度
- tableviewcell自适应高度当中遇到添加label作为contentView,在实际显示时右侧出现空白
- UItableView Cell 高度自适应--随着多个label内容变化自适应
- Swift cell与Label的自适应高度
- 在iOS7中让表视图变成iOS6的圆角矩形与纯汉字文本的cell高度自适应
- ios7 UITableViewCell高度自适应
- 自动布局小知识--UITableViewCell自定义高度,Label长度自适应
- iOS 中 cell和 label 的自适应高度
- IOS中Cell高度的自适应(ios6、ios7)
- iOS 给tableView 每行设置预估行高estimatedRowHeight,达到cell高度的自适应
- iOS Label文本自适应高度
- iOS_label高度自适应文字
- 一行搞定cell自适应高度 -- ZXPAutoLayout框架的使用
- Cell 高度自适应 SDAutoLayout-Cell
- Cell 的简单自适应高度
- IOS TableView的Cell高度自适应,UILabel自动换行适应(转载)
- 【iOS7开发笔记】tableview之通过代码自定义cell(cell的高度不一致)
- iOS 客户端学习-UITableViewCell高度自适应