J'ai créé une barre de titre personnalisée pour mon application Android. Tout va bien, sauf que j'ai placé une case à cocher sur la barre de titre et que je souhaite que ma case à cocher soit positionnée plus à gauche (pour pouvoir l'aligner avec les cases à cocher de chaque élément de la liste). Je n'arrive pas à comprendre comment le déplacer plus à gauche. C'est presque comme si ça me permettait de le dire. Voici une capture d'écran de ce que je veux dire, ainsi que mon XML titlebar:Positionnement de la barre de titre personnalisée
http://i28.tinypic.com/2dpfn9.png
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
style="?android:attr/windowTitleBackgroundStyle"
android:layout_height="?android:attr/windowTitleSize"
>
<CheckBox
android:id="@+id/inbox_selectall"
android:text=""
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="left|center_vertical"
android:focusable="false"
android:background="@drawable/checkbox_background"
android:button="@drawable/checkbox"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerVertical="true">
<TextView
xmlns:android="http://schemas.android.com/apk/res/android"
style="?android:attr/windowTitleStyle"
android:id="@+id/inbox_title"
android:text="@string/title_inbox"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:gravity="center_vertical|center_horizontal"
android:background="@null"
android:fadingEdge="horizontal"
android:scrollHorizontally="true"
/>
</LinearLayout>
</RelativeLayout>
En effet, le problème est le padding 9-patch, la zone où vous pouvez écrire ne va pas à gauche, il y a quelques pixel.Well repéré. – Sephy