Why does my programmatically created screenshot look so bad on iOS 7?

后端 未结 5 900
梦毁少年i
梦毁少年i 2020-11-29 19:46

I am trying to implement sharing app with facebook. I used this code to take the screenshot:

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


        
5条回答
  •  粉色の甜心
    2020-11-29 20:00

    you can try this

    - (UIImage *) screenshot {
        UIGraphicsBeginImageContextWithOptions(self.view.bounds.size, NO, [UIScreen mainScreen].scale);
    
        [self.view drawViewHierarchyInRect:self.view.bounds afterScreenUpdates:YES];
    
        UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
        UIGraphicsEndImageContext();
        return image;
    }
    

提交回复
热议问题