Pregunta

I'm working with this project IOS-Image-Swiper

and I'm trying to set images in the view with no success.

    self.photos = [[NSMutableArray alloc] initWithObjects:
             [UIImage imageNamed:@"green.png"],
             [UIImage imageNamed:@"green.png"],
             [UIImage imageNamed:@"green.png"],
             nil];

Thanks for helping.

¿Fue útil?

Solución

self.imgView.animationImages =  @[[UIImage imageNamed:@"img1.png"], [UIImage imageNamed:@"img2.png"],[UIImage imageNamed:@"img3.png"],];

Otros consejos

try this one:

        UIImageView *myImageView = [[UIImageView alloc] initWithImage : 
              [UIImage imageNamed :@“uiimage.png"]];
        UIView *myUIView = [[UIImageView alloc] initWithFrame :CGRectMake(0,10,20,40)]; 
        myUIView = myImageView;

OR:

   UIImageView *background = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"uiimage.png"]];
  [self addSubview:background];
  [self sendSubviewToBack:background];

Try this one, Hope it'll help you..

NSArray * imageArray = [NSArray arrayWithObjects:[UIImage imageNamed:@"apple5.jpg"],[UIImage imageNamed:@"green.png"],[UIImage imageNamed:@"red.png"], nil];

imageView.animationImages = imageArray;
imageView.animationDuration = 4;
[imageView startAnimating];
[self.view addSubview:imageView];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top