码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-12-25 21:00:28      阅读:155      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!