Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

push到下一个控制器时,隐藏tabBar,手势返回过程中tabBar为什么是空白的 #12

Open
carlchou00 opened this issue Apr 13, 2019 · 4 comments

Comments

@carlchou00
Copy link

carlchou00 commented Apr 13, 2019

  • (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (self.childViewControllers.count > 0) {
    viewController.hidesBottomBarWhenPushed = YES;
    }
    }

我在你的demo里用代码写了UITabBarController,替代了stroyboard,能复现这个问题,好像截屏截不到Tabbar
Screen Shot 2019-04-13 at 16 24 01
Screen Shot 2019-04-13 at 16 23 29

@carlchou00
Copy link
Author

        if (!nav.tabBarController.tabBar.isHidden) {
            CGRect tabFrame = (CGRect){nav.tabBarController.tabBar.frame.origin.x, nav.tabBarController.tabBar.frame.origin.y - 1, nav.tabBarController.tabBar.frame.size};
            UIView *tabShot = [nav.view.window resizableSnapshotViewFromRect:tabFrame afterScreenUpdates:NO withCapInsets:UIEdgeInsetsZero];
            tabShot.frame = tabFrame;
            [_rootView addSubview:tabShot];
        }

添加了如上代码对tabBar进行截图解决了这个问题

@changsanjiang
Copy link
Owner

👌

@carlchou00
Copy link
Author

👌

我好奇的是为什么你的demo里,用storyBord在手势返回时可以看到tabBar,用代码写的就不行

@changsanjiang
Copy link
Owner

显示模式默认走的是截图, tabbar也会被截取到.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants