ios - How to make a gif never stops in UIWebView? -



ios - How to make a gif never stops in UIWebView? -

i have gif in uiwebview, when animation ends, stops. how can never stop?

this code:

self.video uiwebview gif videogif.gif

- (void)viewdidload { [super viewdidload]; self.video.delegate=self; nsstring *filepath = [[nsbundle mainbundle] pathforresource:@"videogif" oftype:@"gif"]; nsdata *gif = [nsdata datawithcontentsoffile:filepath]; [self.video loaddata:gif mimetype:@"image/gif" textencodingname:nil baseurl:nil]; self.video.userinteractionenabled = no; self.video.scalespagetofit=yes; self.video.contentmode = uiviewcontentmodescaleaspectfit; } -(void)webviewdidfinishload:(uiwebview *)webview { self.video.scalespagetofit=yes; self.video.contentmode = uiviewcontentmodescaleaspectfit; }

thanks!!

you can utilize uiview animations. here utilize uibutton animation. may , alternative way. here code:

nsmutablearray *imagearray=[nsmutablearray new]; for(int i=1;i<=16;i++){ [imagearray addobject:[uiimage imagenamed:[nsstring stringwithformat:@"win_%d.png",i]]]; } [animatedbutton setimage:[uiimage imagenamed:@"win_1.png"] forstate:uicontrolstatenormal]; [animatedbutton.imageview setanimationimages:[imagearray copy]]; animatedbutton.imageview.animationduration = .50; [animatedbutton.imageview startanimating];

ios ios7 uiwebview ios8

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -