iOS10-- snapshotViewAfterScreenUpdates 失效
2016-09-19 16:02
941 查看
如果snapshotViewAfterScreenUpdates失效, 用这个方法替代, 不过要自己创建ImageView 替代方式:
- (UIImage *)imageFromView:(UIView *)snapView { UIGraphicsBeginImageContext(snapView.frame.size); CGContextRef context = UIGraphicsGetCurrentContext(); [snapView.layer renderInContext:context]; UIImage *targetImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return targetImage; }
UIImage *image = [self imageFromView:fromVC.fromVCImageView]; UIImageView *snapView = [[UIImageView alloc] initWithImage:image]; snapView.frame = fromVC.fromVCImageView.frame; [containerView addSubview:snapView];
相关文章推荐
- xcode创建一个工程的多个target,应对不同的环境
- 使用 xcode 8 构建版本 iTunes Connect 获取不到应用程序的状态的解决办法
- iOS 学习笔记 手势识别
- iOS 学习笔记 触摸事件
- iOS 富文本(NSMutableAttributedString)详解
- iOS远程推送Push开发教程
- iOS10推送教程详解
- iOS直播第一步~
- 适配iOS10
- iOS_Pass iOS hotfix 热更新 JSPatch 个人服务搭建方案
- iOS巅峰之解决隐藏tabbar后原位置无法响应点击事件的问题
- 苹果开发者账号申请与简介
- iOS-75-分享Xcode使用技巧(兼容iOS10、iPhone刷机固件、Xcode各版本、内存泄漏检测)
- iOS 学习笔记 视图切换
- iOS Remote Notification远程消息推送处理
- 让你的Xcode8 支持 iOS7
- ios10 相机等权限
- iOS企业版分发关于plist和证书的那些事
- IOS快速删除项目工程中不用的图片资源
- ios10 相机等权限