SegmentedControlRevisited icon indicating copy to clipboard operation
SegmentedControlRevisited copied to clipboard

Can't click inside subviews after changing frame and bounds of UINavigationView

Open MCKRUZ opened this issue 12 years ago • 0 comments

I wanted to have the UINavigation controller at the bottom of the screen rather then the top. So I created this method to move it.

  • (void) setupNavController { // Initialize the Navigation Controller navigationController = [[UINavigationController alloc] init];

    // Get the bounds of the main view CGRect viewFrame = self.view.frame;

    // Get the height of the toolbar CGFloat barHeight = self.navigationController.navigationBar.frame.size.height;

    // Calculate the new y for the bar CGRect navFrame = navigationController.view.frame; navFrame.origin.y = ((viewFrame.size.height - viewFrame.origin.y) - barHeight); navigationController.view.frame = navFrame;

    // Calculate the new bounds of the views in the nav controller CGRect navBounds = navigationController.view.bounds; navBounds.origin.y = viewFrame.size.height; navigationController.view.bounds = navBounds; }

It all works perfectly until you go to try to click inside the views, which you can't. It's almost as if the clickable area isn't correct.

Any suggestions?

MCKRUZ avatar Jan 23 '13 19:01 MCKRUZ