0

我正在截取当前视图的屏幕截图:

UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, 0);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
self.bitmapImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();

在某些情况下,这会调用-drawRect:,但并非总是如此。这是为什么?

ps 这似乎是一个错误的行为。

4

0 回答 0