gpt4 book ai didi

iphone - UIImagePickerController...让它从右边出现

转载 作者:行者123 更新时间:2023-11-29 11:17:20 25 4
gpt4 key购买 nike

我必须展示一个 UIImagePickerController,但当我这样做时,它总是自下而上。有没有办法让它从右到左出现?

我已经尝试过但没有成功:

CATransition* transition = [CATransition animation];
transition.duration = 0.35f;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];

[self.navigationController presentModalViewController:picker animated:YES];

谢谢

最佳答案

我假设您当前正在通过调用 presentModalViewController:animated: 并传递 YES 作为动画选项来显示选择器。

您可以做的是在没有动画的情况下呈现,而是使用您自己的过渡动画覆盖外观。下面的例子将从右边开始:

CATransition *transition = [CATransition animation];
transition.duration = 0.5;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
transition.type = kCATransitionMoveIn;
transition.subtype = kCATransitionFromRight;
[self.view.window.layer addAnimation:transition forKey:nil];

[self presentModalViewController:pickerController animated:NO];

要使用它,您需要 #import <QuartzCore/QuartzCore.h>并将 QuartzCore 框架添加到项目中。

关于iphone - UIImagePickerController...让它从右边出现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8861561/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com