我想在ImageView
中顯示動畫的「.gif」。 現在我管理它就像這裏:click 與UIImage+animatedGIF
。但是,如果它開始動畫2動畫,它使用45Mb的內存,我認爲這是非常多的2 GIF 100KB。我能做什麼? 代碼從這裏開始動畫:UIImageView中的動畫gif
NSString *path = [[NSBundle mainBundle]pathForResource:@"animation" ofType:@"gif"];
NSURL *url = [[NSURL alloc] initFileURLWithPath:path];
_testImage.image = [UIImage animatedImageWithAnimatedGIFURL:url];
_test1.image = [UIImage animatedImageWithAnimatedGIFURL:url];
你可以張貼一些你正在使用,以動畫GIF文件的相關代碼? – 68cherries
它太長我從github得到這裏是鏈接: https://github.com/mayoff/uiimage-from-animated-gif/blob/master/uiimage-from-animated-gif/UIImage%2BanimatedGIF.m – user3195648
你認爲我應該從GIF導入每張圖片到支持文件文件夾,並應通過代碼更改圖片? – user3195648