【问题标题】:view in HeaderInSection size not increasing在 HeaderInSection 中查看大小不增加
【发布时间】:2013-09-21 05:45:18
【问题描述】:

我尝试在 uitabelview 中为部分指定标题,包含视图大小的标签无法增加超过 50,这是我的代码,

-(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
if(tableView.tag==20)
{
    UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 55)];
    [view addSubview:label];
    [view setBackgroundColor:[UIColor colorWithRed:166/255.0 green:177/255.0 blue:186/255.0 alpha:1.0]]; 
    return view;
}
}

如何添加如图所示的部分,

【问题讨论】:

    标签: ios ipad uitableview


    【解决方案1】:

    我认为这将解决您的问题。

    - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
     return 100;
    }
    

    享受编码......

    【讨论】:

      【解决方案2】:

      转到 setction Height 中 Table set 中的 xib 见下图

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-02-09
        • 2010-12-06
        • 1970-01-01
        • 2012-02-09
        • 2016-03-29
        相关资源
        最近更新 更多