PresentModalViewController в UISplitViewControllers detailView не представляет представление в полноэкранном режиме

Я добавил представление UISplitViewController в мое представление mainViewControllers, код приведен ниже.

    documentsRootViewController = [[DocumentsRootViewController alloc] initWithStyle:UITableViewStylePlain];
    UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:documentsRootViewController];
    documentsRootViewController.title = @"Document List";

    documentDetailView = [[DocumentsDetailView alloc] initWithNibName:@"DocumentsDetailView" bundle:nil];
    documentsRootViewController.detailViewController = documentDetailView;

    docSplitViewController = [[UISplitViewController alloc] init];
    docSplitViewController.viewControllers = [NSArray arrayWithObjects:navigationController, documentDetailView, nil];
    docSplitViewController.delegate = documentDetailView;

    CGRect splitViewFrame = CGRectMake(0, 0, cetralArea.frame.size.width, cetralArea.frame.size.height);         
    docSplitViewController.view.frame = splitViewFrame;
    [cetralArea addSubview:docSplitViewController.view];

теперь я хочу представить ViewController из DetailView UISplitViewController. Я пытаюсь сделать это, как показано ниже внутри DetailViewControllers Click Me! кнопки щелкают.

enter image description here

- (IBAction) buttonClicked:(id)sender
{
    NSString *phrase = nil; // Document password (for unlocking most encrypted PDF files)    
    NSArray *pdfs = [[NSBundle mainBundle] pathsForResourcesOfType:@"pdf" inDirectory:nil];    
    NSString *filePath = [pdfs lastObject]; assert(filePath != nil); // Path to last PDF file

    ReaderDocument *readerDocument = [ReaderDocument withDocumentFilePath:filePath password:phrase];    
    if (readerDocument != nil) // Must have a valid ReaderDocument object in order to proceed with things
    {
        ReaderViewController *rViewController = [[ReaderViewController alloc] initWithReaderDocument:readerDocument];        
        rViewController.delegate = self; // Set the ReaderViewController delegate to self              

        [self presentModalViewController:rViewController animated:NO];        
    } 
}

но это приводит к неудобному представлению

enter image description here

кто-нибудь может подсказать, в чем здесь проблема, заранее спасибо..

11
задан Shashank 24 April 2012 в 15:57
поделиться