È possibile creare un pulsante con un layout xml personalizzato?Pulsante con layout XML personalizzato
ho questo schema:
<?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>
Ora voglio usare questo su un pulsante. Qualcuno sa come posso fare questo?
Stavo pensando se ho avuto Button.java file che ha esteso Button. E poi setView (R.layout.mylayout.xml); ... ma che è stato a facile, e chiaramente non funziona
saluti Martin
tutto è così facile. Grazie per le informazioni di oggi! :) – f0rz