无法更改 Xcode (iPad) 中模式视图的呈现和过渡样式
我目前在模态视图和弹出窗口方面遇到一些问题。这可能是同样的问题,但我不确定。
我在模态视图中遇到的问题是我无法更改动画或过渡样式。例如,我编写了内容
self.modalPresentationStyle = UIModalPresentationPageSheet;
self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:IpModal animated:YES];
,但模态视图仍然以其原始过渡样式全屏显示。
另外,我遇到的弹出窗口问题非常相似。即使我使用“NO”作为参数调用missPopover:animated:方法,过渡仍然是动画的。
提前致谢。
I'm currently having some trouble with modal views and popovers. It might be the same problem, but I'm not sure.
The problem I'm having with modal views is that I can't change the animation or transition style. For instance, I write
self.modalPresentationStyle = UIModalPresentationPageSheet;
self.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
[self presentModalViewController:IpModal animated:YES];
but the modal view still appears full screen with its original transition style.
Also, the problem I'm having with popovers is pretty similar. Even though I call the dismissPopover:animated: method with "NO" as the parameter, the transition is still animated.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
modalPresentationStyle
和modalTransitionStyle
适用于要以模态方式呈现的视图控制器,而不是执行呈现的控制器。你的代码应该是
modalPresentationStyle
andmodalTransitionStyle
apply to the view controller that is to be presented modally, not the controller doing the presenting.Your code should be
我在自定义转场中这样做了。
I did this in custom segue.
希望这有帮助!
Hope This Helps !
也许您可以尝试使用这两种方法之一来呈现弹出窗口控制器,具体取决于您希望它出现的位置,而不是
presentModalViewController:animated:
。Perhaps you could try using one of these two methods to present the popover controller, depending on where you want it to appear, rather than
presentModalViewController:animated:
.