ImageSwitcher 实际上是做什么的?
我正在尝试快速启动我的 Android 应用程序,我发现 ImageSwitcher 在各种动画任务中被大量引用,但 google 文档完全简明扼要,除了类中的方法之外,没有描述任何其他内容。同时这些例子都使用了gallery,并且没有解释为什么。
有没有人有链接(或愿意解释)有关该类实际用途及其用途的任何信息?
I'm trying to snaz up my android apps and I see that ImageSwitcher is being referenced a lot for all sorts of animation tasks, but the google docs are totally spartan and don't describe anything other than the methods that are in the class. Meanwhile the examples all make use of gallery, and don't explain why.
Does anyone have a link to (or care to explain) any info on what the class actually does and how it's meant to be used?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我无法给出明确的答案,因为我从未使用过它。我最好的猜测来自于继承链的工作...
ViewAnimator...
视图切换器
然后查看
ViewSwitcher
的另一个直接子类...文本切换器
因此,从字里行间看,
ImageSwitcher
是一个ViewAnimator< /code> 它针对图像(即可绘制对象)进行了优化,并且由于它直接继承自
ViewSwitcher
它只能有两个图像。因此,解释一下
TextSwitcher
概述,我想说...每当
被调用时,ImageSwitcher 都会将当前图像动画化并动画化 。正如我所说,这只是一个“最佳猜测”
I can't give a definitive answer as I've never used it. My best guess comes from working down the inheritance chain...
ViewAnimator...
ViewSwitcher
Then looking at another direct subclass of
ViewSwitcher
...TextSwitcher
So reading between the lines, an
ImageSwitcher
is aViewAnimator
which is optimised for images (i.e., drawables) and as it inherits directly fromViewSwitcher
it can only have two images.So, paraphrasing the
TextSwitcher
overview, I would say that...Whenever
<insert setImageXXX method here>
is called, ImageSwitcher animates the current image out and animates the new image in.As I said, it's just a 'best guess'.