Android 微调器在不同位置具有不同的图标(图像)

发布于 2025-01-02 10:40:46 字数 44 浏览 2 评论 0原文

我是安卓新手。我想在微调项目的不同位置设置不同的图标(图像)。我该怎么做?

I am new to Android. I want to set different icon (images) at different position of spinner item. How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入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!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文