美文网首页
tabBar莫名其妙消失问题

tabBar莫名其妙消失问题

作者: 唔将 | 来源:发表于2017-01-19 18:04 被阅读162次

    我项目里面也出现问题,tabBar在pop回来后莫名其妙消失了,我开始写的代码是

    [self.navigationController popToRootViewControllerAnimated:YES];

    MainTabBarViewController *tab = (MainTabBarViewController *)[UIApplication sharedApplication].keyWindow.rootViewController;

    tab.selectedIndex = 4;

    后来去网上找了一大堆东西,发现也没有用(我的MainTabBarViewController是继承UITabBarController写的一些封装),后来直接将取值变为赋值就好了,但是就是没有了pop的动画效果,代码如下:

    MainTabBarViewController *tab = [[MainTabBarViewController alloc] init];

    [UIApplication sharedApplication].keyWindow.rootViewController = tab;

    tab.selectedIndex = 4;

    也试过用核心动画来自己实现pop的动画效果,但是都不尽如人意,有的会有空白页面过渡,有的和pop的效果不一样,反正就是动画效果没了.不知道各位有没有好的方法将这个pop的动画效果实现.

    相关文章

      网友评论

          本文标题:tabBar莫名其妙消失问题

          本文链接:https://www.haomeiwen.com/subject/pwiibttx.html