presentModalViewController无法全屏显示

| 仅横向应用程序。在主窗口xib上,我有一个UIView。我正在以编程方式将UIScrollview加载到该UIView中,效果很好。在该scrollview上,我有一个按钮,该按钮通过presentModalViewController调用调出一个“详细信息”屏幕(一个单独的视图控制器):
    LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@\"LearnITViewController\" bundle:nil];
self.learnitView = learnit;
[self presentModalViewController:learnit animated:YES];    
[learnit release];
当滚动视图为子视图时,将调用该动作,但模式视图不会占据整个屏幕。相反,它会弹出父滚动视图并翻转方向等。这不是所需的行为。 当调用来自scrollview时如何使模式视图全屏显示,这是主XIB上容器UIView的子视图吗?     
已邀请:
        感谢所有的评论。在覆盖presentModalViewController并在循环中冒泡直到到达主控制器(在我的情况下为HomeViewController)的某个地方找到了提示。像冠军一样工作。
- (void) presentModalViewController:(UIViewController *)screen animated:(BOOL)animated {
    UIResponder *responder = self;
    while (responder && ![responder isKindOfClass:[HomeViewController class]]) {
        responder = [responder nextResponder];
    }
    [(UIViewController *)responder presentModalViewController:screen animated:YES];
}
我正在重写UIScrollview的.m文件,该文件包含进行调用的按钮。     
        尝试将
subview
而不是
presentModelViewController
加为:
LearnITViewController *tempView = [[LearnITViewController alloc] initWithNibName:@\"LearnITViewController\" bundle:[NSBundle mainBundle]];
self.learnITViewController = tempView;
[tempView release];
[self.view addSubview:mainMenuView.view]; 
并添加此
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation 
{
// Return YES for supported orientations.
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);//or left
}
    
        
LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@\"LearnITViewController\" bundle:nil];
self.learnitView = learnit;
[self.learnitView setsetWantsFullScreenLayout:YES];
要么
self.learnitView.wantsFullScreenLayout = YES;
[self presentModalViewController:learnit animated:YES];    
[learnit release];
    
        代替
self
,在
superview
中添加
UIViewController
LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@\"LearnITViewController\" bundle:nil];
self.learnitView = learnit;
[self.view.superview presentModalViewController:learnit animated:YES];    
[learnit release];
    

要回复问题请先登录注册