iOS18 TabbarController 切换动画

升级 iOS18后, TabbarController 切换会带有一个缩放动画,下面是自定义取消动画的代码

objectivec 复制代码
#import "TabBarVC.h"

@interface TabBarVC () <UIViewControllerAnimatedTransitioning, UITabBarControllerDelegate>


@end

@implementation TabBarVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.delegate = self;
}

#pragma mark - UITabBarControllerDelegate
- (nullable id <UIViewControllerAnimatedTransitioning>)tabBarController:(UITabBarController *)tabBarController
            animationControllerForTransitionFromViewController:(UIViewController *)fromVC
                                                       toViewController:(UIViewController *)toVC {
    
    return self;
}

#pragma mark - UIViewControllerAnimatedTransitioning
- (void)animateTransition:(nonnull id<UIViewControllerContextTransitioning>)transitionContext {
    UIView *toView = [transitionContext viewForKey:UITransitionContextToViewKey];
    [transitionContext.containerView addSubview:toView];
    [transitionContext completeTransition:YES];
}

- (NSTimeInterval)transitionDuration:(nullable id<UIViewControllerContextTransitioning>)transitionContext {
    return 0;
}


@end
相关推荐
2501_915921431 小时前
掌握 iOS 26 App 性能监控,从监测到优化的多工具组合流程
android·macos·ios·小程序·uni-app·cocoa·iphone
2501_916008892 小时前
手机 iOS 系统全解析,生态优势、开发机制与跨平台应用上架实践指南
android·ios·智能手机·小程序·uni-app·iphone·webview
I烟雨云渊T3 小时前
iOS原生与Flutter的交互编程
flutter·ios·交互
马拉萨的春天3 小时前
iOS的动态库和静态库的差异区别以及静态库的好处
macos·ios·cocoa
肖老师xy3 小时前
苹果(IOS)制作开发和发布证书
ios
马拉萨的春天5 小时前
探索Objective-C中的对象复制:深入理解copy和mutableCopy
开发语言·ios·objective-c
00后程序员张5 小时前
Fiddler使用教程,全面掌握Fiddler抓包工具的配置方法、代理设置与调试技巧(HTTPHTTPS全解析)
前端·测试工具·ios·小程序·fiddler·uni-app·webview
2501_916008895 小时前
HTTPS 下的 DDoS 防护与抓包分析实战,从检测到快速缓解的工程化打法
网络协议·ios·小程序·https·uni-app·iphone·ddos
2501_915918415 小时前
App 使用 HTTPS 的工程化实战,从接入到真机排查的一线指南
android·ios·小程序·https·uni-app·iphone·webview
hookserver6 小时前
企业微信ipad协议接口优势
http·ios·微信·企业微信·ipad·企微