zoukankan      html  css  js  c++  java
  • iOS开发UITableView随笔

    1、设置cell的间隔

    - (void)setFrame:(CGRect)frame{
        frame.size.height -=10;
        [super setFrame:frame];
    }

    2、刷新row或者section(一定要初始化NSArray和NSIndexSet,不用用字面量初始化 会闪退)

       [myTableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath, nil] withRowAnimation:UITableViewRowAnimationNone];
       [myTableView reloadSections:[NSIndexSet indexSetWithIndex:section] withRowAnimation:UITableViewRowAnimationNone];

    3、TableView的UITableViewAutomaticDimension和estimatedRowHeight

      UITableViewAutomaticDimension:自适应单元格高度 (默认也是这个)

      estimatedRowHeight:是一个预估高度,iOS11之前是为0,在iOS11下,这个值默认为44。减少调用heightForRowAtIndexPath方法以提高性能。

  • 相关阅读:
    记一次主从同步出现错误
    Mycat的学习
    MHA高可用集群
    MySQL进行 行累计
    设定从某个时间执行脚本,直到现在
    跟踪数据
    爬虫笔记
    爬虫练习
    css3-文本阴影
    vue生命周期
  • 原文地址:https://www.cnblogs.com/xianfeng-zhang/p/9294930.html
Copyright © 2011-2022 走看看