- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我想使用自定义 UIPresentationController。对于它,当我想显示新场景时,我调用此代码
UIViewController *cv = [[...]];
cv.transitionManager=[[MyTransition alloc] init];
cv.transitioningDelegate=actionSheet.transitionManager;
cv.modalTransitionStyle = UIModalPresentationCustom;
[self presentViewController:cv animated:YES completion:^{
}];
我的过渡经理有方法:
#pragma mark - UIViewControllerTransitioningDelegate
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForPresentedController:(UIViewController *)presented presentingController:(UIViewController *)presenting sourceController:(UIViewController *)source{
return self;
}
- (id <UIViewControllerAnimatedTransitioning>)animationControllerForDismissedController:(UIViewController *)dismissed{
return self;
}
- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForPresentation:(id <UIViewControllerAnimatedTransitioning>)animator{
return nil;
}
- (id <UIViewControllerInteractiveTransitioning>)interactionControllerForDismissal:(id <UIViewControllerAnimatedTransitioning>)animator{
return self;
}
- (UIPresentationController *)presentationControllerForPresentedViewController:(UIViewController *)presented presentingViewController:(UIViewController *)presenting sourceViewController:(UIViewController *)source {
MyPresentationController *presentationController = [[MyPresentationController alloc] initWithPresentedViewController:presented presentingViewController:presenting];
return presentationController;
}
但是方法 presentationControllerForPresentedViewController 没有调用!
为什么?
最佳答案
仅当您使用 UIModalPresentationCustom
呈现样式呈现 View Controller 时才会调用它
关于ios - 为什么不调用 UIViewControllerTransitioningDelegate 的 presentationControllerForPresentedViewController 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26504752/
我正在尝试使用UIPresentationController(和UIViewControllerTransitioningDelegate)通过自定义呈现器以模态方式呈现 View Controll
我目前正在使用自定义动画器显示模态视图 Controller 。一切正常,但是,当我呈现模态视图 Controller 然后旋转设备时,呈现的模态视图 Controller 不会相应地调整大小。 通过
我正在尝试使用自定义转换实现自定义弹出窗口,但我的委托(delegate)方法根本没有被调用。这是我的过渡代表: public final class ModalTransitioningDelega
我正在尝试创建 SwiftUI 自定义 segue 动画,就像这样 我尝试将动画链接到 Destination 但没有用,它只是在演示动画完成后在 Destination 的内容中进行动画处理。 st
我使用 UIViewControllerTransitioningDelegate 在 UITableViewController 之上显示另一个 ViewController。 这有助于避免用 Vi
所以我尝试在 tvOS 10 上的 View Controller 之间进行动画转换。 UIViewControllerTransitioningDelegate 协议(protocol)在 tvOS
我想实现自定义 ViewController 转换。那里有很多解决方案。其中大多数都基于 UIViewControllerContextTransitioning 或 UIViewController
这就是我现在做的: func presentOverlayController(controller: UIViewController) { controller.modalPresenta
1) 我的任务是使用自定义动画呈现和关闭模态 UIViewController。 2)自定义动画是改变alpha并移动一个子元素 3) 我创建了 FadeInAnimationController 和
在我的应用程序中,我有几个用于自定义转换的类。在 Swift 3 之前,一切都运行良好。但是,在更新到 Swift 3 后,func presentationController(forPresent
我尝试向我的应用添加自定义转场动画,但不断收到此错误: Cannot assign value of type 'SlideAnimation.Type' to type 'UIViewControl
我通过实现 UIViewControllerTransitioningDelegate 协议(protocol)中的方法,为模态视图 Controller 创建了自定义过渡动画。 在 iOS 8 和
从 iOS7 开始,我们可以使用 UIViewControllerTransitioningDelegate 创建从 View Controller 到 View Controller 的自定义转换,
我想使用自定义 UIPresentationController。对于它,当我想显示新场景时,我调用此代码 UIViewController *cv = [[...]]; cv.transitionM
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 6 年前。 Improve t
我试图在点击按钮时以模态方式呈现一个 View ,该 View 首先与按钮具有相同的帧,然后展开以结束全屏,所有这些都使用 UIViewControllerTransitioningDelegate。
我是一名优秀的程序员,十分优秀!