Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: HorizontalScrollView in a ListView row Item, focus issue

I have a ListView that each item has a layout that contains a HorizontalScrollView. the problem is that I can't get the whole list item to be focused on when the user clicks or touches a list item.

how can I solve this ?

Thanks

Edit: the HorizontalScrollView looks like this:

<HorizontalScrollView
         android:layout_width="fill_parent"
    android:layout_height="wrap_content"

        android:fillViewport="true"
        android:scrollbars="none"
        android:focusable="false"
        android:fadingEdge="none"

        android:layout_weight="1"
        android:id="@+id/scrollView" 
        ></HorizontalScrollView>
like image 978
Mina Wissa Avatar asked Jan 10 '12 16:01

Mina Wissa


1 Answers

OK Guys, I got it. in the LinearLayout wrapping my HorizontalScrollView I added the following attribute:

android:descendantFocusability="blocksDescendants"

so the HorizontalScrollView did not receive focus.

thanks

like image 156
Mina Wissa Avatar answered Sep 27 '22 19:09

Mina Wissa