I have a SplitViewController, with a rightbarbuttonitem on navigation that its'n resizing when I change the orientation from portrait to Landscape, my rightbarbuttonitem is out of bounds
The rightbarbuttomitem is a customview (blue color background).
I attach some pics of the problem:
And my code:
in appdelegate:
masterViewController = [[MasterViewController alloc] initWithFeed:feedData];
UINavigationController *masterNavigationController = [[UINavigationController alloc] initWithRootViewController:masterViewController];
detailViewController = [[DetailViewController alloc] initWithFeed:[feedData.secciones objectAtIndex:0]];
[detailViewController setSeccionData:[feedData.secciones objectAtIndex:0]];
UINavigationController *detailNavigationController = [[UINavigationController alloc] initWithRootViewController:detailViewController];
detailNavigationController.navigationBar.tintColor = [UIColor getHexColorWithRGB:@"e2de09" alpha:1.0f];
self.splitViewController = [[UISplitViewController alloc] init];
self.splitViewController.delegate = detailViewController;
masterViewController.delegate=detailViewController;
self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil];
self.window.rootViewController=self.splitViewController;
and in my DetailViewController init the rightbarbuttonitem with a custom view:
self.navigationItem.rightBarButtonItem=nil;
NSArray *buttons;
buttons = [NSArray arrayWithObjects:@"send",@"reload",nil];
tools=[[Toolbar alloc] initWithFrame:CGRectMake(0, 0, 110, 30) parentController:detalleDG buttons:buttons];
tools.delegate=self;
UIBarButtonItem *btnRight=[[UIBarButtonItem alloc] initWithCustomView:tools.view];
self.navigationItem.rightBarButtonItem=btnRight;
I tried with detailNavigationController.navigationBar.autoresizingMask=UIViewAutoresizingFlexibleWidth; or tools.view.autoresizingMask=UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; but nothing
Any suggestion? Thanks