A table slide opens under the navigation bar when the user briefly

I have UINavigationController(NC) containing a UITableViewController(TVC0). When the user types a line, he loads UIPageViewController(PVC), which moves back and forth between the others UITableViewController(TVC1).

TVC0 is displayed inside the NC (this means that it does not hide behind the navigation bar at the top or the tab bar at the bottom). When he pushes the PVC, the first TVC1 appears inside the borders of the navigation bar and the tab bar. However, when I sit down, TVC1 inside is hidden behind the navigation bar and the tab bar. I can pull it out to open the contents, but when I release it, it leans back behind the panel.

How can I make everything appear between two columns? I cannot use the storyboard (because it is an outdated application) and the embed in ... option is not available.

[change]

I added a few protocols and found that my built-in TVC1s frame has an absolute start of 0, 64, but as soon as I click it goes to 0, 0. If I cannot find a real solution, I can always fake it by adding 64, but I would rather understand what is actually wrong.

[/ Edit]

[More to edit]

I tested a different area in the iOS 6 simulator and found that this paging works flawlessly in iOS 6. Therefore, the problem I see relates to iOS 7.

[/ More Edit]

Here is my TVC0 viewDidLoad, PVC pageViewController:viewControllerBeforeViewController:and auxiliary viewControllerAtIndex::

- (void) viewDidLoad
{
    [super viewDidLoad];
    NSDictionary* options = [NSDictionary dictionaryWithObject:
                             [NSNumber numberWithInteger: UIPageViewControllerSpineLocationMin]
                                                        forKey:
                             UIPageViewControllerOptionSpineLocationKey];
    self.pageController = [[UIPageViewController alloc] initWithTransitionStyle:
                           UIPageViewControllerTransitionStyleScroll
                                                          navigationOrientation:
                           UIPageViewControllerNavigationOrientationHorizontal
                                                                        options: options];

    self.pageController.dataSource = self;
    self.pageController.view.frame = self.view.frame;
    NSArray* viewControllers =
            [NSArray arrayWithObject: [self viewControllerAtIndex: self.initialIndex]];

    [self.pageController setViewControllers: viewControllers
                                  direction: UIPageViewControllerNavigationDirectionForward
                                   animated: NO
                                 completion: nil];

    [self addChildViewController: self.pageController];
    [self.view addSubview: self.pageController.view];
    [self.pageController didMoveToParentViewController: self];

    for (UIGestureRecognizer* recognizer in self.pageController.gestureRecognizers)
    {
        if ([recognizer isKindOfClass: [UITapGestureRecognizer class]])
        {
            recognizer.enabled = NO;
        }
    }
}

// SearchResultsList is TVC1
- (SearchResultsList*) viewControllerAtIndex: (NSUInteger) index
{
    if (index >= self.items.count)
    {
        return nil;
    }

    SearchResultsList* retVal = [[SearchResultsList alloc]
                                    initWithNibName: @"SearchResultsList" bundle: nil];

    MyListItem* myItem = [self.items objectAtIndex: index];
    MyMatchesRequest* matches = [[MyMatchesRequest alloc] initWithItemId: myItem.itemId];
    [matches execute: ^(MySearchResults* results)
     {
         retVal.tableData = [NSMutableArray arrayWithArray: results.items];
         retVal.view.frame = self.view.frame;
         retVal.myItem = myItem;
         retVal.index = index;
         self.title = myItem.displayText;
         [[retVal tableView] reloadData];
     }];

    return retVal;
}

- (UIViewController*) pageViewController: (UIPageViewController*) pageViewController
      viewControllerBeforeViewController: (UIViewController*) viewController
{
    SearchResultsList* vc = (SearchResultsList*)viewController;
    if (vc.index == 0)
    {
        [self.navigationController popViewControllerAnimated: YES];
        return nil;
    }

    return [self viewControllerAtIndex: vc.index - 1];
}
+4
3

, , ,

self.pageViewController.definesPresentationContext = YES; 

 viewControllerWhichIsApageInPageController.modalPresentationStyle = UIModalPresentationCurrentContext
+2

: (

init:

self.automaticallyAdjustsScrollViewInsets = NO;

UIViewController, YES iOS 7

UIViewController

+14

. , viewDidLoad, PVC . , . , , .

TVC0, PVC, . viewDidLoad, didSelectRowAtIndexPath. , , navigationController. ( , ).

:

    [self addChildViewController: self.pageController];
    [self.view addSubview: self.pageController.view];
    [self.pageController didMoveToParentViewController:self];

    [self.navigationController pushViewController:self.pageController 
                                         animated:YES];

( TVC0 - , , TVC0)

, , UINavigationController translucent navigationBar.

, , - , , , .

"" . navBar, automaticallyAdjustsScrollViewInsets YES, , pageViewController (_UIQueuingScrollView) contentOffset.y -64 pageViewController. , pageVC (, ), , contentOffset. , , . . , pageViewController.

automaticallyAdjustsScrollViewInsets , . , pageViewController.

, , , , , .

  • translucent, .

  • , , , , .

  • pageViewController tableViewController tableView - , , , .

  • viewControllerBeforeViewController pageViewController, , parentViewController (tableViewController) - ? , .

. .

+2

All Articles