Nazik
Nazik

Reputation: 8444

UITabBarController not responding

I'm using a UITabBarController with UINavigationControllers like this

enter image description here

I add this to the view using

tabctrl.view.frame = CGRectMake(0, 0, 320, 548);
[self.view addSubview:tabctrl.view];

The screen looks like

enter image description here

But I can't switch to other tab(ie, touching on tabctrl's tab has no response)

If I change the frame like

tabctrl.view.frame = CGRectMake(0, 0, 320, 488);

then the screen looks like,

enter image description here

Now, I can touch the tab and switch to required viewcontroller. How to solve this issue?

I need to get access to the tabctrl when its frame height is 568.

I'm using xcode 4.6.2 and ios simulator 4inch retina.

Upvotes: 0

Views: 816

Answers (3)

vampirewalk
vampirewalk

Reputation: 839

Set your rootViewController's wantsFullScreenLayout property to YES

tabbarController.wantsFullScreenLayout = YES

This should solve your tabbar switching issue on 4-inch screen

Upvotes: 1

Prateek Prem
Prateek Prem

Reputation: 1544

Use this code:

 [appDelegate.window setRootViewController:tabctrl];

rather than:

tabctrl.view.frame = CGRectMake(0, 0, 320, 568);
[self.view addSubview:tabctrl.view];

Upvotes: 2

Efesus
Efesus

Reputation: 197

Your tabbar controller might be behind something else on the bottom of the screen. You can test it with code:

[self.view bringSubviewToFront: tabctrl]

If this fixes your problem, try to find which view is in front of your tabbar controller

Upvotes: 1

Related Questions