将视图列表为按钮
我正在尝试使用包含名称和 ID 号的数据集填充列表视图。我知道我将一个数组传递给视图适配器,但不知道如何将印刷机与 ID 号关联起来。
您如何处理此功能?
任何人都可以给我指点任何教程吗?
I am trying to populate a list view with a data set that contains a name and an Id number. I know that I pass an array to the view adapter but do not know how to associate the press to the ID number.
How do you handle this functionality?
Can any one point me to any tutorials?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你想要一个 onitemclicklistener 为你的列表视图
无法从我的手机链接到您,但它在 android 开发人员文档上
链接: http ://developer.android.com/reference/android/widget/ListView.html
You want an onitemclicklistener for your listview
Can't link you from my phone, but its on the android developer docs
Link: http://developer.android.com/reference/android/widget/ListView.html
您最好创建自定义适配器并在自定义适配器内设置 OnClickListener。
您可以使用以下内容
http://www.softwarepassion。 com/android-series-custom-listview-items-and-adapters/
You better create custom adapter and set OnClickListener inside the custom adapter.
here is something you can use
http://www.softwarepassion.com/android-series-custom-listview-items-and-adapters/
everyview 有一个名为 Tag 的属性,例如 TextView.setTag()
当您创建像 listitem.setTag(ID Number); 这样的列表视图时使用它
在 onItemClickListener 中,您可以获得对单击的列表项的引用,
用它来检索标签。
There is a property of everyview called Tag , e.g. TextView.setTag()
Use it when you are creating listview like listitem.setTag(ID Number);
In the onItemClickListener , you get the reference to the listitem on which you clicked,
use it to retrieve the tag.