0

I'm adding a tabbarcontroller to the main view controller. If I touch the title below the image logo of the tabbar it won't respond. If I click the image of the tabbar, it gets a click and selected. This issue is only iPhone 5(4 inch screen). But it works fine in 3.5 inch device.

Please, refer the below the image, area inside red border won't respond to touch for all tabbars.

enter image description here

Same issue occurs in both device a.w.a simulator. I remember a post with full tabbar click access here in StackOverflow, but can't find it right now. Please suggest a solution for this.

Nazik
  • 8,696
  • 27
  • 77
  • 123

2 Answers2

1

Edit

Based on your comment

I added the tabbarcontroller using, tabctrl.view.frame = CGRectMake(0, 20, 320, 548); [self.view addSubview:tabctrl.view];

You should also initialize the tabBar with window bounds or self.view or try not setting the view and tabbar will set it itself

Previous Answer

Enable FullScreen for the MainWindow in the utilities inspector enter image description here

Shubhank
  • 21,721
  • 8
  • 65
  • 83
  • But there is no mainwindow in my project. What to do now? – Nazik Mar 07 '14 at 06:36
  • how are you initializing the window then in your project ? – Shubhank Mar 07 '14 at 06:36
  • In the didfinishlaunching method, I added `self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; self.viewController = [[ViewController alloc] initWithNibName:@"ViewControlleriPhone5" bundle:nil]; self.window.rootViewController = self.viewController;` – Nazik Mar 07 '14 at 06:38
  • There is no MAinwidow.xib file in my project. I just add the tabbarcontroller to that viewcontroller. – Nazik Mar 07 '14 at 06:39
  • In theAppdelegate.h file , I used `@interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window;` – Nazik Mar 07 '14 at 06:40
  • okay how do you initialize tabbar controller , post that code also – Shubhank Mar 07 '14 at 06:41
  • I added the tabbarcontroller using, `tabctrl.view.frame = CGRectMake(0, 20, 320, 548); [self.view addSubview:tabctrl.view];` – Nazik Mar 07 '14 at 06:58
  • `@property (nonatomic, retain) IBOutlet UITabBarController *tabctrl;` in .h file. – Nazik Mar 07 '14 at 06:59
1
in Main View Controller

-(void) viewDidAppear:(BOOL)animated
{
  [super viewDidAppear:animated];

    // I assumed that you have created yourTabBarController in View did load

    yourTabBarController.view.frame = self.view.bounds;

}