文章目录
- 引言
- I、反馈页面的开发步骤
- 1.2.1 方法一: 截图内容不包含_UIAlertControllerShimPresenterWindow 且不包含AlertView的方法:
- 1.2.2 方法二:iOS根据视图尺寸获取视图截屏【截图内容包括UIAlertController和UIAlertView】
- 1.1、 监听截图通知
- 1.2、 截图方法:
- II demo源码
- 2.1 本文的完整demo
- 2.2、反馈页面封装成SDK `pod 'KNPodlib'`
- see also
引言
原文:
注意:截图在弹反馈页面之前create
I、反馈页面的开发步骤
1.1、 监听截图通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(userDidTakeScreenshot:) name:UIApplicationUserDidTakeScreenshotNotification object:nil];
- 释放Observer
-(void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; // self.navigationItem.hidesBackButton = NO; }
1.2、 截图方法:
1.2.1 方法一: 截图内容不包含_UIAlertControllerShimPresenterWindow 且不包含AlertView的方法:
- iOS根据视图尺寸获取视图截屏【View Snapshots】how do I take a snapshot of my view and save the result in a UIImage?
1.2.2 方法二:iOS根据视图尺寸获取视图截屏【截图内容包括UIAlertController和UIAlertView】
II demo源码
2.1 本文的完整demo
- 从CSDN资源下载demo源码https://download.csdn.net/download/u011018979/14981241
2.2、反馈页面封装成SDK pod 'KNPodlib'
- pod ‘KNPodlib’
pod lib :Improve feedback interface and customize webview functionality
- 支持放大查看图片
see also
- 图片九宫格推荐使用这个代码
iOS上传图片【支持删除和添加】(使用UICollectionViewCell、UITableViewCell 及Masonry。采用MVVM实现。)