Tuesday, January 28, 2014
ListView content of varying lengths lead to some bad clicking Item
Such as the title, because the ListView item is dynamically loaded, some relatively short, is not easy to trigger click event, how about this solution?
Reply:
The width is set about to try fill_parent
Reply:
Set up, does not work. .
Reply:
It is set a little higher ah
Reply:
I do not know a little higher upstairs that is what it meant, in fact, my listview only one TextView,
But TextView in the length of the text may be different,
I have TextView width to fill_parent in the layout of the document, but seemingly still wrap_content effect,
Cause if the text is short, then it is difficult to point to an item,
Younger beginner android, just thinking should be able to get a wide TextView some of it, but do not want to set a fixed width TextView, where are we going with a what attributes?
Reply:
Change the layout, ah, four layouts, with the use, how could this problem.
Reply:
I saw you in StackOverFlow same problem: android: listview item width fill_parent doesnt work
http://stackoverflow.com/questions/4552977/android-listview-item-width-fill-parent-doesnt-work
Solve the answer is:
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.
Reply:
Which event listener you use? OnItemClickListener
Reply:
Well, do not listen TextView click, listen ItemClick
Reply:
I use ListActivity, I just set up the layout of the item file, forget ListActivity layout file listview or wrap_content ...
Reply:
My question to you, as you can whisper "
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment