IBScrollViewFloatingHeader icon indicating copy to clipboard operation
IBScrollViewFloatingHeader copied to clipboard

Using on a storyboard tableview with iOS7 behavior

Open jerometonnelier opened this issue 10 years ago • 1 comments

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 ;)

jerometonnelier avatar Jul 25 '14 07:07 jerometonnelier

If you make the uinavigationbar opaque instead of translucent, it works as designed.

paulius005 avatar Jan 21 '15 21:01 paulius005