【问题标题】:Is is possible to define the height of a UITableView's tableHeaderView purely based on Auto layout?是否可以纯粹基于自动布局来定义 UITableView 的 tableHeaderView 的高度?
【发布时间】:2015-01-30 10:36:22
【问题描述】:

似乎tableHeaderView 的大小具有恒定的高度,即使为情节提要启用了自动布局也是如此。我可以用自动布局定义它的子视图的大小,但不能定义它自己的视图。

使用代码或界面生成器,这可能吗?

【问题讨论】:

    标签: ios uitableview interface-builder autolayout


    【解决方案1】:

    我猜你不能用 AutoLayout 但用代码设置标题高度 尝试设置 tableHeaderView 的 frame 属性。

    UITableView *tableView;
    CGRect frame = tableView.tableHeaderView.frame;
    frame.size.height = 200;
    tableView.tableHeaderView.frame = frame;
    

    【讨论】:

      猜你喜欢
      • 2014-01-25
      • 2015-03-10
      • 1970-01-01
      • 1970-01-01
      • 2013-08-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-08-28
      相关资源
      最近更新 更多