首页 > 其他 > 详细

UITableViewCell笔记

时间:2017-01-14 10:17:03      阅读:274      评论:0      收藏:0      [点我收藏+]
  1. 默认的四种cell的类型 技术分享 原网站 还有这个带图的 据我自己试验,只有value2不自带imageview
  2. 不同的accessoryType 技术分享 可以看到,一个tabelviewcell的contentview被缩短了。右边是显示附件的view。 技术分享
  3. 设置accessoryView
    contentView也变短了,此时设置的accessoryType没用了。accessoryView的大小也会影响到contentview的大小 技术分享 技术分享
  4. 设置缩进

    • indentationLevelindentationWidth

      indentationLevelindentationWidth乘积是缩进的距离。 indentationWidth默认是10point。

      if indexPath.row == 0 {
          cell?.indentationLevel = 2;
      }
      else if indexPath.row == 1
      {
          cell?.indentationLevel = 2;
          cell?.indentationWidth = 20;
      }
      

    技术分享

  5. 设置分隔线的范围
    separatorInset
    默认分割线距离左边最短是15point。可以通过这个方法来设置。但是好像改变了这个值,系统默认的textlabel什么的也会移动。

            cell?.separatorInset = UIEdgeInsetsMake(0, 0, 0, 0)
    

    技术分享

            cell?.separatorInset = UIEdgeInsetsMake(0, 30, 0, 40)
    

    技术分享

UITableViewCell笔记

原文:http://www.cnblogs.com/huahuahu/p/UITableViewCell-bi-ji.html

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