首页 > 其他 > 详细

头大的一篇日志 细节总结 唐诗三百首

时间:2015-12-25 20:59:04      阅读:326      评论:0      收藏:0      [点我收藏+]

首先最令人头疼的问题 cell随着label的自动行高问题

下面几行代码解决了,,,,

 

 self.tableView.estimatedRowHeight = 120; 预设行高

 _label.numberOfLines = 0;

self.tableView.rowHeight = UITableViewAutomaticDimension;

设置label 利用masonry

[cell.label mas_makeConstraints:^(MASConstraintMaker *make) {
       make.edges.equalTo(cell).with.insets(UIEdgeInsetsMake(5,5,5,5));
    }];

解释这样解决问题了

// Returning this value from tableView:heightForHeaderInSection: or tableView:heightForFooterInSection: results in a height that fits the value returned from
// tableView:titleForHeaderInSection: or tableView:titleForFooterInSection: if the title is not nil.

UITableViewAutomaticDimension

 关于添加tableView视图到viewcontroller得view中后,实现协议的后,tableView上面出现的一大块空白的解决方法

://iOS 7 viewcontroller新增属性automaticallyAdjustsScrollViewInsets,即是否根据按所在界面的navigationbar与tabbar的高度,自动调整scrollview的 inset,设置为no,让它不要自动调整就可以了
    self.automaticallyAdjustsScrollViewInsets =NO;

头大的一篇日志 细节总结 唐诗三百首

原文:http://www.cnblogs.com/zhao-jie-li/p/5076878.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!