Some Gap remains between Table Top and Table Header only when table loads and scrolled down to the last row?

前端 未结 1 2005
傲寒
傲寒 2021-01-16 08:38

Edit: It works fine, But still when the table get Loads Some gap remains between table top and table header abt 30 pxcls(or 1 row) ..?

Please help....

I am

相关标签:
1条回答
  • 2021-01-16 08:56

    If I understand your question correctly, it sounds like you just need the table not to bounce. If that's the case, all you need to do is set yourTable.bounces = NO; in your viewDidLoad function. Either that or uncheck the "Bounces" option in the NIB if you used one to layout your table.

    Here's how to fix the problem you mentioned in your edit... You need to replace the following references to tableView.headerView with references to a new view that's not being passed into the delegate method.

        UIView *headerView = [[[UIView alloc] initWithFrame:rectArea] autorelease];
        //...    
        [headerView setBackgroundColor:[UIColor grayColor]];
        //...
        [headerView addSubview:lbl];
        //...
        return headerView;
    

    I tried it and it did the trick for me. Hope that helps.

    0 讨论(0)
提交回复
热议问题