解决内存暴涨的问题,下面的方法会造成内容暴涨,

2018-08-07  本文已影响0人  布谷布谷7788

-(UIImage*)getNormalImage:(UIView*)view{

    float width = [UIScreen mainScreen].bounds.size.width;

    float heigt = [UIScreen mainScreen].bounds.size.height;

    UIGraphicsBeginImageContext(CGSizeMake(width, heigt));

    CGContextRef context = UIGraphicsGetCurrentContext();

    [view.layer.presentationLayer renderInContext:context];

    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();

    UIGraphicsEndImageContext();

    returnimage;

}

不停的使用以上方法,造成了内存暴涨的现象

上一篇 下一篇

猜你喜欢

热点阅读