Voilà à quoi il ressemble: http://i.imgur.com/navAYXk.jpgToggle est pas centré
Et voici le code responsable de la mise en page: (togglebutton en question est le dernier)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/LinearLayout01"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/controls"
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@drawable/border" >
<ImageButton
android:id="@+id/playpause"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@null"
android:src="@drawable/player_play"
android:text="play/pause" />
<ImageButton
android:id="@+id/prev"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@null"
android:src="@drawable/player_prev"
android:text="prev" />
<ImageButton
android:id="@+id/next"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@null"
android:src="@drawable/player_next"
android:text="next" />
<ToggleButton
android:id="@+id/shuffleButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.25"
android:background="@null"
android:button="@drawable/toggle_check"
android:layout_gravity="center"
android:textOff=""
android:textOn="" />
</LinearLayout>
</LinearLayout>
Et voici le fichier Toggle_check .xml:
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/player_shuffle_on"
android:state_checked="true" />
<item android:drawable="@drawable/player_shuffle_off"
android:state_checked="false"/>
</selector>
Je ne sais pas pourquoi cette image est togglebutton pas centrée, quelqu'un peut me aider?