Bouton avec le custom XML de mise en page

Est-il possible de créer un bouton avec un xml personnalisé de mise en page?

J'ai cette mise en page:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="fill_parent"
  android:layout_height="wrap_content"
  android:padding="1dp"
  android:background="#7e7e7e">

 <RelativeLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="fill_parent"
   android:layout_height="wrap_content"
   android:padding="10dp"
   android:background="#f9f9f9">

 <TextView
  android:id="@+id/TextView01" 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content"
  android:layout_alignParentLeft="true"
  android:text="ButtText"
  android:textColor="#000000">
 </TextView>

 <ImageView 
  android:id="@+id/ImageView01" 
  android:layout_width="wrap_content" 
  android:layout_height="wrap_content" 
  android:background="@drawable/arrow"
  android:layout_alignParentRight="true">
 </ImageView>

 </RelativeLayout>
</LinearLayout>

Maintenant, je veux l'utiliser sur un bouton. Quelqu'un sait comment je peux faire cela?
Je pensais que si j'avais Button.java fichier étendu Bouton. Et puis setView(R.layout.mylayout.xml); ... mais que c'était facile, et il n'est clairement pas de travail

Ce Qui Concerne Martin

OriginalL'auteur f0rz | 2010-02-25