PresentModalViewController 不全屏显示
仅横向应用程序。在我的主窗口 xib 上,我有一个 UIView。我正在以编程方式将 UIScrollview 加载到 UIView 中,效果很好。在该滚动视图上,我有一个按钮,可以通过 PresentModalViewController 调用调出“详细信息”屏幕(单独的视图控制器):
LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@"LearnITViewController" bundle:nil];
self.learnitView = learnit;
[self presentModalViewController:learnit animated:YES];
[learnit release];
正在调用该操作,但当滚动视图打开时,模式视图不会占据整个屏幕。一个子视图。相反,它会弹出到父滚动视图并翻转方向等。这不是所需的行为。
有关如何在调用来自滚动视图(主 xib 上容器 UIView 的子视图)时使模态视图全屏显示的任何指导吗?
Landscape only app. On my main window xib, I've got a UIView. I'm loading a UIScrollview programatically into that UIView which works just fine. On that scrollview, I've got a button that brings up a "detail" screen (a separate view controller), via a presentModalViewController call:
LearnITViewController *learnit = [[LearnITViewController alloc] initWithNibName:@"LearnITViewController" bundle:nil];
self.learnitView = learnit;
[self presentModalViewController:learnit animated:YES];
[learnit release];
The action's being called but the modal view doesn't take up the whole screen when the scrollview is a subview. Instead, it's popping into the parent scrollview and flipping the orientation, etc. Not the desired behavior.
Any guidance on how to make the modal view full screen when the call is from scrollview which is a subview of a container UIView on the main xib?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
感谢所有的评论。在某处发现了一个关于重写presentModalViewController并在循环中冒泡直到到达主控制器(在我的例子中为HomeViewController)的提示。像冠军一样工作。
我在包含进行调用的按钮的 UIScrollview 的 .m 文件中进行重写。
Thanks for all the comments. Found a tip somewhere on overriding presentModalViewController and bubbling up in a loop until the main controller's reached (in my case, HomeViewController). Worked like a champ.
I'm overriding in the .m file of the UIScrollview that contains the button that makes the call.
尝试添加
subview
,而不是presentModelViewController
作为:并添加此
Try adding
subview
, rather thanpresentModelViewController
as:And add This too
或者
or
在
superview
中添加UIViewController
,而不是self
。Instead of
self
addUIViewController
insuperview
.