我想在列表视图中显示每行多个listitems。 显示没有问题,因为我重写getView和getCount。 但问题在于onItemClickListener:我似乎无法区分哪个listitem被点击。 关于如何完成此任何想法?android listview with multiple listitems per row
0
A
回答
0
感谢@dophil我学习了GridView组件,它完全符合我的需求! 谢谢@dophil
0
为了区分哪个listitem被点击,您可以在适配器的getView()方法中提供该项的click监听器。
+0
那样我最终可能会创建数百个clicklisteners,没有唯一正确的解决方案是来自@dymmeh的建议GridView,它是为了它 – vanleeuwenbram 2012-04-20 20:38:21
相关问题
- 1. LINQ Select Row with Max date per group
- 2. Listview with multiple select复选框
- 3. Android listview with each items in each row
- 4. Android setcolour listview row
- 5. Android ListView row padding/margin
- 6. DynamicList with Multiple Columns
- 7. android set alarmmanager with multiple extra arguments
- 8. Android Listview with Listview item
- 9. N-per-group with JOIN
- 10. iCarousel with per image reflection
- 11. Android Listview with clickable buttons
- 12. android listview row number remove zero
- 13. Android - Parcelable | putParcelableArrayListExtra(“ListItems”,listItems);
- 14. listview with checkbox android
- 15. android listview with actionmode
- 16. For loop with multiple variables
- 17. Clickable row with datatables
- 18. MySQL Query GROUP_CONCAT Over Multiple Row
- 19. MvC multiple submits diffrent columns same row
- 20. Spring Multiple Multiple HttpSecurity with Multiple Dispatcher servlets
- 21. android listview滚动到listitems的数量
- 22. cancelAllLocalNotifications With Multiple LocalNotifications
- 23. CKeditor with multiple textareas
- 24. HandleOpenURL with multiple pathExtension
- 25. Linq with multiple tables
- 26. jQuery with multiple slideToggle
- 27. ToLookup with multiple keys
- 28. sumif with multiple conditions
- 29. NSPredicate with multiple statements
- 30. maven with multiple artifactID
好奇:为什么不使用gridview来完成同样的事情,但你保留点击时区分不同项目的能力? – dymmeh 2012-04-20 16:42:54
你在行上设置了onclicklistener。 – 2012-04-20 16:58:16
与onClicklistener你只能得到一个位置,而不是左或右的项目,这是不可能的。 啊,我不知道gridview组件,但它似乎很有趣,因为它也使用了一个适配器 如果您将它作为答案发布,我会将其标记为解决方案 – vanleeuwenbram 2012-04-20 17:14:50