csc*_*uff 8 animation uinavigationbar uiview uiimage ios
我发现这个代码非常好:
+ (UIImage *) imageWithView:(UIView *)view
{
UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, [[UIScreen mainScreen] scale]);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
Run Code Online (Sandbox Code Playgroud)
但我也需要捕获UINavigationBar,因为我想在我的UIStoryboardSegue中将图像用作过渡层.有任何想法吗?