Editeur online : https://angrytools.com/android/button/
Toutes les possibilités (changement en fonction des états) : http://mrbool.com/how-to-customize-different-buttons-in-android/27747
Personnalisation : http://tools.tutorialsbuzz.com/btntool/buttontool.php
l’utilitaire ci-dessus permet de créer des boutons, suivre les indications.
Sinon :
1°) Définir dans res/drawable un fichier « forme ».xml :
<!-- rectangle aux bords arrondis, avec un dégradé mauve en fond et un bord gris -->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners android:radius="7dp" />
<stroke android:width="2dp" android:color="#4c4c33" />
<gradient android:angle="270" android:startColor="#999966"
android:endColor="#4c4c33" />
</shape>
2°) dans le layout placez le bouton :
<Button
android:id="@+id/bteltrans"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignLeft="@+id/bswitch"
android:layout_below="@+id/bswitch"
android:background="@drawable/forme"
android:layout_marginTop="32dp"
android:text="@string/EtatFrom" />
Votre commentaire