LKM
LKM

Reputation: 2450

iOS) How to make Tab View with fixed view at the top and bottom

I'm in trouble making tab view as I want.

Here's my plan, At the top and bottom, there is each fixed view. so there must be in-between view. At there I want to insert Tab bar and subviewcontrollers.

But by using storyboard and tabbarController, I have to make same fixed views for every sub viewcontroller, isn't it?

How can make it right?

Upvotes: 0

Views: 980

Answers (1)

Jose Thomas
Jose Thomas

Reputation: 566

You can import view from the tab bar controller to the in-between view in the View controller.

Give a storyboard id to the tab bar controller. Here I am using "Tab".

UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
UITabBarController* tab = [storyboard instantiateViewControllerWithIdentifier:@"Tab"];
tab.view.frame = self.inBetweenView.bounds; // replace with your view's name
[self.inBetweenView addSubview:tab.view];

[self addChildViewController:tab];
[tab didMoveToParentViewController:self];

Upvotes: 2

Related Questions