IBScrollViewFloatingHeader
IBScrollViewFloatingHeader copied to clipboard
Using on a storyboard tableview with iOS7 behavior
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];
Thanks for your help ;)
If you make the uinavigationbar
opaque instead of translucent, it works as designed.