有没有一种方法可以在iOS中呈现ViewController的同时保持呈现的ViewController可见?现在,动画一结束,PresentingViewController似乎就会隐藏起来。
发布于 2013-12-28 22:06:01
使用来自UIModalPresentationStyle的值来控制这一点。
UIModalPresentationPageSheet或UIModalPresentationFormSheet将导致演示文稿在下面留下大量的演示视图控制器。
在正在显示的视图控制器上设置modalPresentationStyle
e.g
presentedViewController.modalPresentationStyle = UIModalPresentationFormSheet;
[presentingViewController presentViewController:presentedViewController animated:YES completion:nil];发布于 2015-03-16 21:58:24
显示:
if let popupVC = storyboard.instantiateViewControllerWithIdentifier("PopupVC") as? PopupVC
{
var frame = UIScreen.mainScreen().bounds
frame.origin.y = frame.size.height
overlayWindow = UIWindow(frame: frame)
popupVC.overlayWindow = overlayWindow
overlayWindow.windowLevel = UIWindowLevelAlert
overlayWindow.rootViewController = popupVC
overlayWindow.makeKeyAndVisible()
UIView.animateWithDuration(0.3, animations:
{
self.overlayWindow.frame.origin.y = 0
})
}在PopupVC中隐藏
if let window = overlayWindow
{
UIView.animateWithDuration(0.3, animations: {
window.frame.origin.y = window.frame.height
}, completion: { (finished) -> Void in
self.overlayWindow = nil
})
}https://stackoverflow.com/questions/20815400
复制相似问题