In my app, I'd like to do something similar to what Spotify does in their app.
They add a UIView
(the red bar) above all other views in the app. I tried doing it by adding the following code to my RootSplitViewController
, but that doesn't work.
- (void)viewWillAppear:(BOOL)animated {
[self.view addSubview:[[BannerView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 44.0f)]];
for (int i = 0; i < [self.viewControllers count]; i++) {
UIViewController *vc = [self.viewControllers objectAtIndex:i];
vc.view.frame = CGRectMake(vc.view.frame.origin.x, 44, vc.view.frame.size.width, vc.view.frame.size.height-44);
}
}
This just added a red view on top of my UINavigationBar
, but not "pushing it down". Any ideas on how to approach this?