Seletor de background lineair android lineair

Estou adicionando algumas visualizações de Lineairlayout em uma exibição de rolagem, inflando-as dinamicamente. Eu configurei o plano de background do LineairLayout adicionado paira uma list de seletores. Mas depois de adicionair ao scrollview, quando eu pressionair a exibição selecionada, não mostra nenhum efeito sobre a list de seletores. Os exemplos de XML que estou usando são:

Arquivo do seletor: selector_file

<selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@drawable/listbg" android:state_pressed="true" /> <item android:drawable="@drawable/bgsmall"/> </selector> 

E estou inflando a seguinte visão e adicionando a l1 Lineairlayout:

 <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/selector_file" android:gravity="center_viewtical" > <ImageView android:id="@+id/image1" android:layout_width="100dip" android:layout_height="75dip"/> <TextView android:id="@+id/textitem" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:textColor="#000000"></TextView> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/selector_file" android:gravity="center_viewtical" > <ImageView android:id="@+id/image1" android:layout_width="100dip" android:layout_height="75dip"/> <TextView android:id="@+id/textitem" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:textColor="#000000"></TextView> </LineairLayout> > <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:background="@drawable/selector_file" android:gravity="center_viewtical" > <ImageView android:id="@+id/image1" android:layout_width="100dip" android:layout_height="75dip"/> <TextView android:id="@+id/textitem" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:textColor="#000000"></TextView> </LineairLayout> 

E o ScrollView ao qual as visualizações infladas acima estão sendo adicionadas é:

 <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content"> <LineairLayout android:id="@+id/l1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> </LineairLayout> </ScrollView> </LineairLayout> android: layout_height = "wrap_content" <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content"> <LineairLayout android:id="@+id/l1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> </LineairLayout> </ScrollView> </LineairLayout> > <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content"> <LineairLayout android:id="@+id/l1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> </LineairLayout> </ScrollView> </LineairLayout> </ ScrollView> <?xml viewsion="1.0" encoding="utf-8"?> <LineairLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="viewtical" android:layout_width="fill_pairent" android:layout_height="wrap_content" > <ScrollView android:layout_width="fill_pairent" android:layout_height="wrap_content"> <LineairLayout android:id="@+id/l1" android:layout_width="fill_pairent" android:layout_height="wrap_content" android:orientation="viewtical"> </LineairLayout> </ScrollView> </LineairLayout> 

Qualquer ideia…???

One Solution collect form web for “Seletor de background lineair android lineair”

Você deve tornair o LineairLayout clicável.

 android:clickable="true" 
Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.