iOS11截屏变化

时间:2017-09-20 17:32:31

标签: ios screen nativescript capture

我的屏幕捕获代码工作正常,直到我转移到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));

0 个答案:

没有答案