iOS takes a screenshot of the view according to the view size [View Snapshots] how do I take a snapshot of my view and save the result in a UIImage?

introduction

The screenshots obtained by the solution in this article do not include _UIAlertControllerShimPresenterWindow and AlertView

Method 1:
Call the renderInContext:method of a view's layer

Sometimes the navigation bar cannot be accessed normally

 - (void)renderInContext:(CGContextRef)ctx;

Guess you like

Origin blog.csdn.net/u011018979/article/details/113181607