在imageview中淡出幻灯片. xCode 4.2

在imageview中淡出幻灯片. xCode 4.2,第1张

概述我正在尝试在使用淡入淡出效果的imageview中制作幻灯片. 到目前为止我做到了这一点: - (void)viewDidLoad{ [super viewDidLoad]; animationView = [[UIImageView alloc] initWithFrame:self.view.frame]; animationView.animationImages 我正在尝试在使用淡入淡出效果的imagevIEw中制作幻灯片.

到目前为止我做到了这一点:

- (voID)vIEwDIDLoad{    [super vIEwDIDLoad];    animationVIEw = [[UIImageVIEw alloc] initWithFrame:self.vIEw.frame];    animationVIEw.animationImages = [NSArray arrayWithObjects:                                        [UIImage imagenamed:@"photo1.jpg"],[UIImage imagenamed:@"photo2.jpg"],[UIImage imagenamed:@"photo3.jpg"],nil];    animationVIEw.animationDuration = 5;    animationVIEw.animationRepeatCount = 0;    [animationVIEw startAnimating];    [self.vIEw addSubvIEw:animationVIEw];}

图像确实一个接一个地出现,在5秒的延迟中,我现在想要的是每次出现图像时使它们淡入和淡出,对此有何建议?

在此先感谢您的帮助

解决方法 我试图做类似的事情.我做的是设置一个计时器,在UIImageVIEw上调用UIVIEw TransitionWithVIEw,它通过我的幻灯片照片数组递增.

- (voID)vIEwDIDLoad{[super vIEwDIDLoad];self.welcomePhotos = [NSArray arrayWithObjects:@"welcome_1.png",@"welcome_2.png",@"welcome_3.png",nil];self.imageVIEw1.image = [UIImage imagenamed:[self.welcomePhotos objectAtIndex:0]];[NSTimer scheduledTimerWithTimeInterval:3.0 target:self selector:@selector(TransitionPhotos) userInfo:nil repeats:YES];}-(voID)TransitionPhotos{if (photoCount < [self.welcomePhotos count] - 1){    photoCount ++;}else{    photoCount = 0;}[UIVIEw TransitionWithVIEw:self.imageVIEw1                  duration:2.0                   options:UIVIEwAnimationoptionTransitionCrossdissolve                animations:^{ self.imageVIEw1.image = [UIImage imagenamed:[self.welcomePhotos objectAtIndex:photoCount]]; }                completion:NulL];    }
总结

以上是内存溢出为你收集整理的在imageview中淡出幻灯片. xCode 4.2全部内容,希望文章能够帮你解决在imageview中淡出幻灯片. xCode 4.2所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/1019042.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-23
下一篇 2022-05-23

发表评论

登录后才能评论

评论列表(0条)

保存