gpt4 book ai didi

ios5 - 使用 Storyboard 显示模态视图 Controller 时如何更改大小?

转载 作者:行者123 更新时间:2023-12-02 08:48:51 26 4
gpt4 key购买 nike

使用 Storyboard,我使用模式样式和表单演示创建了到另一个 View Controller 的过渡。但始终具有相同的大小。

如何使用 Storyboard更改此 View Controller 的大小?我发现了一些几乎可以工作的代码,但我从来没有让 mu modal view controller 居中。 How to resize a UIModalPresentationFormSheet?请注意,我使用 Storyboard,并且该代码不适用于 Storyboard。

您有什么想法或建议吗?

顺便问一下,prepareForSegue os 似乎在 viewDidLoad 之前被调用了,这正常吗?

非常感谢您的回复。

最佳答案

虽然有点晚了。

我以前实现过它。我设法让 UIPresentationFormSheet 居中。这是我的代码..

[detailView setModalTransitionStyle:UIModalTransitionStyleFlipHorizontal];
[detailView setModalPresentationStyle:UIModalPresentationFormSheet];
[self presentModalViewController:detailView animated:YES];
detailView.view.superview.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
float heightOfFrame = 200.0f;
float widthOfFrame= 400.0f;
detailView.view.superview.frame = CGRectMake(
self.view.superview.center.x - (widthOfFrame/2),
self.view.superview.center.y - (heightOfFrame/2),
widthOfFrame,
heightOfFrame
);

希望我在某些方面对您有所帮助。

问候,史蒂夫

关于ios5 - 使用 Storyboard 显示模态视图 Controller 时如何更改大小?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10158945/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com