iOS根据视图尺寸获取视图截屏【View Snapshots】how do I take a snapshot of my view and save the result in a UIImage?

引言

本文的方案获取的截图内容不包含_UIAlertControllerShimPresenterWindow 和AlertView

方式一:
调用某个view的layer的renderInContext:方法即可

有时导航条无法正常获取

 - (void)renderInContext:(CGContextRef)ctx;

猜你喜欢

转载自blog.csdn.net/u011018979/article/details/113181607