Skip to content

Using on a storyboard tableview with iOS7 behavior #5

Description

@jerometonnelier

Hi ;-)

I'm having the hardest time to make this component work with a tableView (loaded from a storyboard as a UIViewController that contains a UiTableView).
The VC uses autolayout, it uses "adjust scrollview insets" and "under top bars" edge insets.

If I remove the under top bars, it works like a charm. But if I do, the component is never showed on screen and I have a scrollView content inset visible since there a white space where the component should be.

Here is the code I use and below a screenshot with and without "under top bars" checked.

UIView* container = [UIView new];
container.frame = CGRectMake(0, 0, 320, 45);
container.backgroundColor = WINDOW_TINT_COLOR;
self.statusButton = [UIButton buttonWithType:UIButtonTypeCustom];
self.statusButton.frame = container.bounds;
[self.statusButton setTintColor:WINDOW_TINT_COLOR];
[self.statusButton setTitle:@"statut" forState:UIControlStateNormal];
[self.statusButton addTarget:self action:@selector(showStatusViewController) forControlEvents:UIControlEventTouchUpInside];
[container addSubview:self.statusButton];
[self.tableView setFloatingHeaderView:container];

capture decran 2014-07-25 a 09 36 06
capture decran 2014-07-25 a 09 36 21

Thanks for your help ;)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions