我有半透明导航栏的视图。我试图从中获取图像。但我得到的图像有一个坚实的导航栏。有什么建议吗?
我用来获取图片的代码
- (UIImage *)getImage {
UIImage *image = [[UIImage alloc] init];
UIGraphicsBeginImageContextWithOptions(self.frame.size, self.opaque, 0.0);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}