Ric*_*rdo 2 storyboard modalviewcontroller ios5
使用storyboard,我使用模态样式和表单表单创建到另一个视图控制器的过渡.但总是有相同的大小.
如何使用故事板更改此视图控制器大小?我发现一些代码几乎可以工作,但我从来没有让mu模态视图控制器居中. 如何调整UIModalPresentationFormSheet的大小? 请注意,我使用的是Storyboard,而且该代码不适用于storyboard.
你有什么想法或建议吗?
顺便说一句,似乎prepareForSegue操作系统名为BEFORE viewDidLoad,这是正常的吗?
非常感谢您的回复.
小智 5
虽然有点晚了.
我之前实现过它..我设法让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
);
Run Code Online (Sandbox Code Playgroud)
希望我在某些方面帮助过你.
问候,史蒂夫
归档时间: |
|
查看次数: |
2679 次 |
最近记录: |