iOS 7 taking screenshot of part of a UIView

前端 未结 2 1500
灰色年华
灰色年华 2021-01-30 11:56

I have a view (testView) that is 400x320 and I need to take a screenshot of part of this view (say rect = (50, 50, 200, 200)). I am playing around with the drawViewHierarchy me

2条回答
  •  忘掉有多难
    2021-01-30 12:19

    Try below line of code,

    UIView *popSnapshot=[inputView snapshotViewAfterScreenUpdates:YES];
    

提交回复
热议问题