如何在 ListView 中的项目旁边添加 ImageView?

发布于 2025-01-04 05:22:09 字数 69 浏览 1 评论 0原文

我正在尝试为食物制作食谱 ListView,并且我想在列表中的项目旁边添加 imageView。我怎样才能做到这一点?谢谢。

I am trying to make a recipe ListView for food and I want to add imageViews next to items in my list. How can i do that? Thx.

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

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

各空 2025-01-11 05:22:10

遵循本教程对您来说可能是一个好主意(主要是第二个示例)。

http://www.mkyong.com/android/android-listview-example/

但无论如何,在问这样一个基本问题之前,你应该先谷歌一下。

Following this tutorial could be a nice idea for you (mainly the second example).

http://www.mkyong.com/android/android-listview-example/

But anyway, you should Google a little bit before asking such a basic question.

往事随风而去 2025-01-11 05:22:09

ListView 项目可以有自己的自定义布局。

您必须为 ListView 创建适配器。创建适配器时,您可以分配自定义布局。

注意:您必须实现 getView() 来设置图像+文本的属性。

这里有一个示例: ListView 中图片的延迟加载

A ListView item can have it's own custom layout.

You have to create your adapter for the ListView. When you create your adapter you can assign your custom layout.

Note: You will have to implement getView() to property set the image+text.

Here you have a sample: Lazy load of images in ListView

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