zoukankan      html  css  js  c++  java
  • 头大的一篇日志 细节总结 唐诗三百首

    首先最令人头疼的问题 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;

    追寻最真
  • 相关阅读:
    Java之static理解
    linux安装vsftpd
    JS获取当前时间戳的三个方法
    git常用操作
    npm更新包
    springboot的mvn与gradle启动方式
    mac nginx compile
    [文摘]那些一心想要离开 BAT 的人,后来怎么样了?
    excel 常用法
    chrome 快捷键
  • 原文地址:https://www.cnblogs.com/zhao-jie-li/p/5076878.html
Copyright © 2011-2022 走看看