制作幻灯片
我需要在我的应用程序中包含一个幻灯片,一个简单的幻灯片。一幅图像淡入,而另一幅图像则淡出原位,依此类推。幻灯片放映将驻留在自定义视图中。
我应该手动完成它 - 我的意思是,用图像创建许多视图并调用它们的动画师来更改不透明度 - 还是我在文档中遗漏了某些内容?
我想知道是否有一种“内置”方式。如果没有,通常的步骤是什么?也许我脑子里的想法不是正确的方式。
I need to include a slideshow in my app, a simple one. One images fades in while the other fades out in its place and so on. The slide show will reside in a custom view.
Should I do it by hand — I mean, create many views with images and call their animators so change the opacity — or am I missing something in the documentation?
I wonder if there is a "built-in" way. If not, what are the usual steps to do it? Maybe what I have in my head is not the proper manner.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您只需要 2 或 3 个视图,并动态更改其内容。
您可以通过使顶视图透明,然后更改其内容,然后使其不透明,更改后视图内容,使前视图再次透明来交叉淡入淡出两个视图...如果您想淡入黑色或白色,您可以有一个您淡入的中间视图。
you only need 2, or 3 views, and dynamically change their content.
2 views you could cross fade by making the top view transparent, then changing it's content, then making it opaque changing the back views content, making the front view transparent again...if you wanted to fade to black or white you could have a middle view that you fade to.