我的屏幕捕获代码工作正常,直到我转移到iOS11。我假设他们的API有变化(但我无法在任何地方找到任何东西)。这是我的(Nativescript)代码:
UIGraphicsBeginImageContextWithOptions(view.ios.frame.size, false, 0);
view.ios.drawViewHierarchyInRectAfterScreenUpdates(CGRectMake(0, 0, view.ios.frame.size.width, view.ios.frame.size.height), true);
var imageFromCurrentImageContext = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return imageSource.fromData(UIImagePNGRepresentation(imageFromCurrentImageContext));