我正在使用这个项目 IOS-Image-Swiper
我尝试在视图中设置图片但没有成功。
self.photos = [[NSMutableArray alloc] initWithObjects:
[UIImage imageNamed:@"green.png"],
[UIImage imageNamed:@"green.png"],
[UIImage imageNamed:@"green.png"],
nil];
感谢您的帮助。
答案 0 :(得分:6)
self.imgView.animationImages = @[[UIImage imageNamed:@"img1.png"], [UIImage imageNamed:@"img2.png"],[UIImage imageNamed:@"img3.png"],];
答案 1 :(得分:2)
试试这个:
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];
答案 2 :(得分:2)
试试这个,希望它会帮助你......
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];