Salut,
comment je peux modifier le background d'un linear layout lors d'un survol de souris et en selection?
J'ai essayé avec le selector mais ca ne marche pas.
back.xml
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/Layout1" android:background="@drawable/fond_rouge" android:layout_height="match_parent" android:layout_width="fill_parent" android:orientation="vertical"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/Layout2" android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal" android:layout_marginTop="10dp" android:background="@drawable/back">
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_focused="true" android:state_pressed="false" android:drawable="@android:color/white" <item android:state_focused="true" android:state_pressed="true" android:drawable="@android:color/dark" /> </selector>
Partager