小编A. *_*ejo的帖子

iOS 8崩溃 - renderInContext:UIGraphicsGetCurrentContext()

在iOS 8之前,我现在没有问题,是的.

日志:

Assertion failed: (CGFloatIsValid(x) && CGFloatIsValid(y)), function void CGPathMoveToPoint(CGMutablePathRef, const CGAffineTransform *, CGFloat, CGFloat), file Paths/CGPath.cc, line 254.
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

UIImage* image = nil;

CGSize imageSize = CGSizeMake(self.view.bounds.size.width, self.view.bounds.size.height);

UIGraphicsBeginImageContextWithOptions(imageSize, NO , 0.0f);

[self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; // <- ERROR

image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
Run Code Online (Sandbox Code Playgroud)

我的目的是将视图转换为图像.

core-graphics objective-c ios ios8

5
推荐指数
1
解决办法
3209
查看次数

标签 统计

core-graphics ×1

ios ×1

ios8 ×1

objective-c ×1