CJNavigationController icon indicating copy to clipboard operation
CJNavigationController copied to clipboard

如果配合 uitabcontrolller 使用的时候 tabbar 是黑色的

Open Realwayyyw opened this issue 9 years ago • 5 comments

如果配合 uitabcontrolller 使用的时候 tabbar 是黑色的

我的具体操作是 使用 全部 uiviewcontroller 使用stroyboard

Realwayyyw avatar Nov 18 '15 04:11 Realwayyyw

谢谢,你的问题,我先和你说一下,的确会有这个问题,我自己的项目中已经修改了,忘了提交了,配合 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; } 当然这个判断不是很完善,有问题请说,谢谢

CrazyCJay avatar Nov 18 '15 07:11 CrazyCJay

你好,配合UITabBarController使用时,如: image 当切换tabbaritem时,返回效果截屏出现这样的问题。 image 请问要怎么解决?

KetilDeng avatar May 25 '16 08:05 KetilDeng

很高兴,看到你的提问 你可以把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];

} 有其他问题,欢迎问

CrazyCJay avatar May 25 '16 10:05 CrazyCJay

你好,这个问题还是没有解决哦,主要是在tabbaritem切换的时候,再去跳转然后返回。还是会截屏缺失。 image。你试一下。

KetilDeng avatar May 25 '16 11:05 KetilDeng

我的qq:474072367,你加下我

CrazyCJay avatar May 25 '16 11:05 CrazyCJay