【发布时间】:2014-02-26 10:25:09
【问题描述】:
在我的项目中,我有一个显示视图控制器的按钮(transitionStyle 是coverVertical,modalPresentationStyle 是FormSheet)。我希望视图应该显示在中心,但是单击按钮时,视图会在左侧打开,然后当键盘被放下时,它会在中心移动。谁能告诉我为什么?我用过 viewController.view.superview.center = self.view.center;
查看我在单击按钮时添加的 presentingViewController 代码。
【问题讨论】:
-
请提供一些代码。
-
viewController.modalPresentationStyle = UIModalPresentationFormSheet; viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical; [self presentViewController:viewController 动画:YES 完成:nil]; viewController.view.superview.frame = CGRectMake(0, 0, 540, 650); viewController.view.superview.center = self.view.center; viewController.delegate = self;
-
这是单击按钮时呈现视图的代码
-
请编辑您的问题并插入您的代码,并使用工具使您的问题可读。如果您的问题不明确,将被否决。
-
@AncAinu:检查我编辑的问题。我已经放了代码。
标签: ios objective-c ipad presentviewcontroller