Android 微调器在不同位置具有不同的图标(图像)
我是安卓新手。我想在微调项目的不同位置设置不同的图标(图像)。我该怎么做?
I am new to Android. I want to set different icon (images) at different position of spinner item. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您正在寻找的是自定义对话框。
您基本上想要做的是创建一个自定义对话框并将您自己的动画放入其中。
有多种方法可以制作动画,但我更喜欢使用动画列表。您可以在此处查看如何使用它们: http://developer.android .com/reference/android/graphics/drawable/AnimationDrawable.html
如果您没有一系列图像来创建动画列表,则替代方案可能是使用平移或旋转动画为您的图像添加动画效果。这是一个关于如何做到这一点的非常好的链接。 http://www.barebonescoder.com/2010/ 06/android-development-more-animations-part-1/
了解如何制作动画后,您所要做的就是放入对话框中。
请在此处查看如何执行此操作: http://developer.android.com /guide/topics/ui/dialogs.html#CustomDialog
希望有帮助!
I think what you are looking for is a custom dialog.
What you basically want to do is create a custom dialog and put your own animation in there.
There are a couple of ways to do animation, but I prefer to use animation lists. You can look up how to use them here: http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html
If you don't have a series of images to create an animation list an alterative might be animate your image using a translate or rotate animation. Here's a really great link on how to do that. http://www.barebonescoder.com/2010/06/android-development-more-animations-part-1/
After you figure out how to make an animation, all you have to do is put in a dialog.
Look here for how to do that: http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog
Hope that helps!