Ios 如何在仍能看到背景viewController的情况下显示viewController
照片共享部分是我编写的一个ViewController,当我按下右键时,PhotoSharingViewController将以动画形式出现 这是我的密码:Ios 如何在仍能看到背景viewController的情况下显示viewController,ios,uiactivityviewcontroller,uialertcontroller,Ios,Uiactivityviewcontroller,Uialertcontroller,照片共享部分是我编写的一个ViewController,当我按下右键时,PhotoSharingViewController将以动画形式出现 这是我的密码: PhotoSharingViewController *vc = [[PhotoSharingViewController alloc] init]; [self addChildViewController:vc]; [self.view addSubview:vc.view]; [UIView animateWithDuration:0
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和动画。您完全负责显示视图的位置以及如何设置动画。请参阅我的书或我的书示例,或查看此可下载项目:谢谢,这就是我想要的。