【问题标题】:How to increase the height of custom cell in UITableView如何在 UITableView 中增加自定义单元格的高度
【发布时间】:2012-08-01 02:11:29
【问题描述】:

我有一个用自定义单元格填充的表格视图,现在我想增加单元格的宽度,我增加了 UITableview 的单元格高度。但问题还是一样。任何人都知道如何增加 UITableView 中自定义单元格的高度。

谢谢,

【问题讨论】:

    标签: ios uitableview custom-cell


    【解决方案1】:

    如果您的单元格高度不同,请实现以下委托:

    - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        return 44.0; // edit this return value to your liking
    }
    

    如果他们不这样做,只需将表格视图实例的rowHeight 属性设置为您希望所有单元格的高度。 This answer 很好地解释了原因。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-11-27
      • 1970-01-01
      • 2021-09-17
      • 1970-01-01
      • 2011-04-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多