ios - UIImageView won't animate, static image only -


i have uiimageview on storyboard, linked outlet in code. when run code, shows static picture storyboard shows, not animation create programmatically. ideas?

for(int i=0; i<4; i++) {     uiimage *image = [uiimage imagenamed:[nsstring stringwithformat:@"loading%d",i]];     [self.images addobject:image]; } self.loadingview.animationimages = self.images; self.loadingview.animationduration = 2; self.loadingview.animationrepeatcount = 1; [self.loadingview startanimating]; 

note: loadingview uiimageview, images nsmutablearray.

if want make run time array can use way.

  nsmutablearray *images = [[nsmutablearray alloc] init];      (int = 1 ; < 4; i++) {          [images addobject:[uiimage imagenamed:[nsstring stringwithformat: @"loading%d.jpg", i]]];       }      self.loadingview.animationimages = images;     self.loadingview.animationduration = 2;     self.loadingview.animationrepeatcount = 1;     [self.loadingview startanimating]; 

hope you. it's working fine me.


Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -