0

After I place a HorizontalScrollView surrounding the RelativeLayout, the AutoCompleteTextView is working, the dropdownlist is shown, but the list item is not clickable. So anything I can change?

<HorizontalScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
<RelativeLayout 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content" 
    >

    <ImageView
        android:id="@+id/favicon"
        android:layout_width="20dp"
        android:layout_height="24dp"
        android:layout_marginLeft="4dp"
        android:scaleType="fitXY"
        android:src="@drawable/ic_launcher" 
        android:paddingTop="3dp"
        android:contentDescription="favicon"
        />

    <TextView
        android:id="@+id/text1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="26dp"
        android:text=""
        android:singleLine="true"
        android:ellipsize="end"
        android:textSize="16sp"
        android:textStyle="bold" 

        />

    <TextView
        android:id="@+id/text2"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/text1"
        android:singleLine="true"
        android:ellipsize="end"
        android:textSize="14sp" 
        android:text=""
        android:paddingBottom="3dp"
        />

</RelativeLayout>
</HorizontalScrollView>

I found this question TextView is not clickable inside scrollview in listview? but it isn't working, the ontouch event is not rise up.

Community
  • 1
  • 1
Cheung
  • 15,293
  • 19
  • 63
  • 93
  • Don't add Android to your questions titles, the tag at the bottom is more than enough. – user Sep 05 '13 at 11:20

1 Answers1

0

The scroll hogs your focus, add

"descendantsFocusability:BlocksDesendants" to your scrollview tag

Lena Bru
  • 13,521
  • 11
  • 61
  • 126