无论如何,iPad模态表单占据了整个屏幕 [英] iPad modal form sheet takes up the whole screen anyways
问题描述
我正在尝试在iPad上创建一个表单模式,它应该是540x620模式视图。
I'm trying to create a form sheet modal on iPad, which should be a 540x620 modal view.
我创建了一个带有NIB文件的视图控制器其视图是540x620大小的UIView(上面有东西)。
I've created a view controller with a NIB file whose view is a 540x620 sized UIView (with stuff on it).
我将模态演示样式设置为 UIModalPresentationFormSheet
,并在当前视图控制器上调用 presentModalViewController:animated:
。
I set the modal presentation style to UIModalPresentationFormSheet
, and call presentModalViewController:animated:
on the current view controller.
我的视图从底部滑入,但它不是一张表单,而是占据了整个屏幕(我的视图元素都锚定在左上角)屏幕)。
My view slides in from the bottom, but instead of being a form sheet, it takes up the whole screen (my view elements are all anchored in the top left of the screen).
更奇怪的是,当我解雇它时,所有在它下面的用户界面都被重新布置在中心,大约在一张表单中屏幕中央的大小区域。 Bizarro!
Even stranger, when I dismiss it, all the UI that was "underneath" it, is all re-layed out to be in the center, in approximately a form sheet sized area in the center of the screen. Bizarro!
任何人都有什么可能导致这种行为的建议?
Anyone have any suggestions as to what could cause this behavior?
谢谢。
推荐答案
想出来。我在父视图控制器上设置模式演示样式 - 需要在新创建的子控制器上设置它。人们需要将其视为孩子的财产,而不是父母所控制的财产。
Figured this out. I was setting the modal presentation style on the parent view controller-- it needs to be set on the newly-created child controller. One needs to think of it as a property of the child, not something the parent controls.
我会删除这个问题,但我想把它留作路标对于未来的任性。
I would delete this question, but figure I'll leave it as a signpost for the future wayward.
这篇关于无论如何,iPad模态表单占据了整个屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!