theDuncs
theDuncs

Reputation: 4843

Add subview to view so that it overlays the UITabBar but not the UINavigationBar

I'd like to add an overlay to my current UITableView - so that it overlays the entire table and the UITabBar at the bottom of the screen. I don't, however, want it to overlay the UINavigationController.

When I try [self addSubview:] on the UITableView, it does not overlay the UITabBar.

In my storyboard, I have aUITabBar and each tab instantiates it's ownUINavigationBar. This tab then contains a UITableView.

Any help much appreciated.

Upvotes: 1

Views: 893

Answers (1)

Mayank Jain
Mayank Jain

Reputation: 5754

set y origin of your overlay to 44 and add this overlay to navigation's view

[overlayView setFrame:CGRectMake(self.overlayView.frame.origin.x, 44, self.overlayView.frame.size.width, self.overlayView.frame.size.height)];
[self.navigationController.view addSubview:overlayView];

don't forget to add +20 on y origin value when running on iOS7.

Upvotes: 1

Related Questions