Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/109.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在仍能看到背景viewController的情况下显示viewController_Ios_Uiactivityviewcontroller_Uialertcontroller - Fatal编程技术网

Ios 如何在仍能看到背景viewController的情况下显示viewController

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

照片共享部分是我编写的一个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和动画。您完全负责显示视图的位置以及如何设置动画。

请参阅我的书或我的书示例,或查看此可下载项目:谢谢,这就是我想要的。