繁体   English   中英

如何在仍然看到背景viewController的同时显示viewController

[英]How could I present a viewController while still see the background viewController

在此处输入图片说明

照片共享部分是我编写的ViewController,当我按正确的项目时,PhotoSharingViewController将以动画方式显示。

这是我的代码:

PhotoSharingViewController *vc = [[PhotoSharingViewController alloc] init];
[self addChildViewController:vc];
[self.view addSubview:vc.view];
[UIView animateWithDuration:0.3 animations:^{
    vc.view.frame = CGRectMake(0, 0, WIDTH, WIDTH * 0.8);
} completion:^(BOOL finished) {
}];

但是,我认为这不是一个好方法。 我更喜欢“呈现” viewController,例如UIAlertController或UIActivityViewController。 请问我该怎么办?

您要提供一个自定义过渡。 这样,当presentViewController时,您将提供UIPresentationController以及动画。 您完全负责呈现的视图的位置以及到达该位置的动画效果。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM