我做了简单的动画,但要动画添加到图像像从左至右像滑块一样,我有图片,如何编程制作动画的阵列,动画图像向左像幻灯片
-(void) slideImages
{
NSMutableArray *imagesArrays= [[NSMutableArray alloc]init];
for (SliderDC *slider in imagesArray) {
sliderImageName = slider.sliderImagePath;
NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString: [NSString stringWithFormat:@"%@%@",KWURL ,sliderImageName]]];
UIImage *imgOne = [UIImage imageWithData:imageData];
if(imgOne)
[imagesArrays addObject:imgOne];
}
// after adding all image in array then add animation.
UIImageView* animatedImageView;
if ([[UIScreen mainScreen] bounds].size.height == 568){
animatedImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 65, 320, 150)];
}
else if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
animatedImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 98, 768, 228)];
}
else
{
animatedImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 65, 320, 118)];
}
animatedImageView.animationImages = imagesArrays;
animatedImageView.animationDuration = 20.0f;
animatedImageView.animationRepeatCount = 0;
[self.view addSubview: animatedImageView];
[animatedImageView startAnimating];
}
在创建新图像的动画时,这不显示黑屏吗? – Ahmed 2016-06-06 09:53:54