views:

699

answers:

1

Hi there, I have a ListView with an adapter extending BaseAdapter. I create a view (from a LinearLayout and I put some items ont it depending on some parameters. I have a textview, with a drawable and sometime another textview next to the drawable in this horizontal linearlayout. For some reason, this command doesn't seems to work.

setLayoutParams(new
ListView.LayoutParams(ListView.LayoutParams.FILL_PARENT,
          ListView.LayoutParams.WRAP_CONTENT));

So when my textview doesn't fill the full width of the list, I can only click on the part of the elements with the widget on it. I have try playing a lot with the layout and I can't get this to work. The parameters seems to be ignore all together. Only hack that would work I found was to set a big minimum width on my linearlayout but I don't think that's the best solution.

Thanks a lot,

Jean-Philippe

+1  A: 

Change everything ListView, LayoutContainer and TextView to FILL_PARENT, that should do the job.

Sebastian Deutsch
For some reason, that didn't work for me. I ended up changing the layout for a TableLayout and add a Stretchable Column.
Jean-Philippe Jodoin