我使用此Swift代码裁剪屏幕截图:
UIGraphicsBeginImageContextWithOptions(CGSizeMake(UIScreen.mainScreen().bounds.size.width * 0.25, UIScreen.mainScreen().bounds.size.width * 0.25), false, 0);
self.view.drawViewHierarchyInRect(CGRectMake(UIScreen.mainScreen().bounds.size.width * 0.5,UIScreen.mainScreen().bounds.size.height * 0.5,view.bounds.size.width,view.bounds.size.height), afterScreenUpdates: true)
var image:UIImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
然而,屏幕截图全是白色。我的问题是什么?