CJNavigationController
CJNavigationController copied to clipboard
如果配合 uitabcontrolller 使用的时候 tabbar 是黑色的
如果配合 uitabcontrolller 使用的时候 tabbar 是黑色的
我的具体操作是 使用 全部 uiviewcontroller 使用stroyboard
谢谢,你的问题,我先和你说一下,的确会有这个问题,我自己的项目中已经修改了,忘了提交了,配合 uitabcontrolller 时候,他的superview层级是不一样的,所以你截屏的时候如果没有uitabbar上级view截屏,底下 tabbar是没有的,所以,你只需要把
-
(UIImage *)capture{}中的方法改下
-
(UIImage *)capture { if (self.view.superview.superview.superview) { UIGraphicsBeginImageContextWithOptions(self.view.superview.superview.superview.bounds.size, self.view.superview.superview.superview.opaque, 0.0); [self.view.superview.superview.superview.layer renderInContext:UIGraphicsGetCurrentContext()]; }else{ UIGraphicsBeginImageContextWithOptions(self.view.superview.bounds.size, self.view.superview.opaque, 0.0); [self.view.superview.layer renderInContext:UIGraphicsGetCurrentContext()]; }
UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; } 当然这个判断不是很完善,有问题请说,谢谢
你好,配合UITabBarController使用时,如:
当切换tabbaritem时,返回效果截屏出现这样的问题。
请问要怎么解决?
很高兴,看到你的提问 你可以把m文件小小修改:
-
(void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated { if (self.viewControllers.count > 0) { [self.mScreenShots addObject:[self capture]]; viewController.hidesBottomBarWhenPushed = YES; }
[super pushViewController:viewController animated:animated];
} 有其他问题,欢迎问
你好,这个问题还是没有解决哦,主要是在tabbaritem切换的时候,再去跳转然后返回。还是会截屏缺失。
。你试一下。
我的qq:474072367,你加下我