Requirements Description:
There are two viewcontroller we remember to do A, B, where B controller only shows the lower part;
As the effect:
There are many ways to implement this, you can add a view method, or you can use Uiwindows to implement.
But my side is to use Presentviewcontroller implementation, but a present B, the previous a will disappear, will not and B overlay display, so it is quite a try to intercept a after the present B.
Take a look at the implementation plan:
Method One:
This method gets to the picture without distortion
1-(UIImage *) Captureimagefromviewlow: (UIView *) Orgview {2 //get a picture of a specified view3Uigraphicsbeginimagecontextwithoptions (OrgView.bounds.size, NO,0.0);4Cgcontextref context =Uigraphicsgetcurrentcontext ();5 [Orgview.layer Renderincontext:context];6UIImage *image =Uigraphicsgetimagefromcurrentimagecontext ();7 Uigraphicsendimagecontext ();8 returnimage;9}
Method Two:
Distortion occurs after the captured picture overlay is re-displayed
// get full screen picture -(UIImage *) fullscreenshots{*screenwindow = [[uiapplicationsharedapplication] Keywindow]; Uigraphicsbeginimagecontext (screenWindow.frame.size); // full screen, including window [ScreenWindow.layerrenderInContext:UIGraphicsGetCurrentContext ()]; *viewimage =uigraphicsgetimagefromcurrentimagecontext (); Uigraphicsendimagecontext (); return viewimage;}
In combination with these two scenarios, I finally chose the plan one
iOS Current screen screenshot