方法声明:
- (nullable UIView *)resizableSnapshotViewFromRect:(CGRect)rect afterScreenUpdates:(BOOL)afterUpdates withCapInsets:(UIEdgeInsets)capInsets NS_AVAILABLE_IOS(7_0);
这个方法就是根据frame去截图,然后返回一个view。并且支持拉伸与缩放。
withCapInsets -> 这个和拉伸图片的image.resizableImageWithCapInsets()使用一样
具体参照Apple官方文档。