Search code examples
androidtextviewscrollable

Horizontal scrollable Textview which is in listview in Android?


I have a Listview in which there are 3-4 textviews. I am using the BaseAdapter way where I am inflating xml. All the textviews are single line. I want to make the textview horizontally scrollable. I have tried to put the textview inside HorizontalScrollview. Well, that did scrolled the textview but then I was not able to get the click event of listview.

Is there any other way I can make the textview scrollable horizontally?


Solution

  • I was able to solve this issue by adding this line to first RelativeLayout in the xml file android:descendantFocusability="blocksDescendants". In this way no child will have focus and so the horizontal scrollbar also works and listview item clicks also works. It worked for me. Anyways, thanks everyone.