当前位置: 代码迷 >> Android >> ListView中内容长短不一导致有些Item不好点击,该怎么处理
  详细解决方案

ListView中内容长短不一导致有些Item不好点击,该怎么处理

热度:21   发布时间:2016-05-01 21:22:17.0
ListView中内容长短不一导致有些Item不好点击
如题,因为ListView中的item是动态加载的,有的比较短,就不容易触发点击事件,这个怎么解决呢?

------解决方案--------------------
设置一下项的宽度为 fill_parent 试试
------解决方案--------------------
我在StackOverFlow看到和你一样的问题:android: listview item width fill_parent doesnt work
http://stackoverflow.com/questions/4552977/android-listview-item-width-fill-parent-doesnt-work

解决答案是:
How are you creating your ListView? Is it defined in XML? Are you using a ListActivity? Or are you creating it programmatically? You need to make sure that the ListView itself has a width of fill_parent.
  相关解决方案