0
votes

Bouton à double bordure

est-il possible de créer un tel bouton à l'aide de bibliothèques d'appcCompat ou de conception de matériaux? N'importe quel style pour un tel bouton? Sinon, quelle est la meilleure façon de la mettre en œuvre?

 Entrez la description de l'image ici


0 commentaires

3 Réponses :


4
votes

Vous pouvez utiliser à l'aide de la liste de couches xxx


0 commentaires

1
votes

Essayez de cette façon en utilisant COUCHE-LISTE CODE> STROND>

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!--  the first <item> is used to set border to this drawable  -->
    <item>
        <shape android:shape="rectangle">
            <padding
                android:bottom="2dp"
                android:left="2dp"
                android:right="2dp"
                android:top="2dp" />
            <solid android:color="#E91E63" />
            <corners android:radius="10dp"/>
        </shape>
    </item>
    <!--  the second <item> is used to add some space between border and inner
      rectangle object -->
    <item>
        <shape android:shape="rectangle">
            <padding
                android:bottom="3dp"
                android:left="3dp"
                android:right="3dp"
                android:top="3dp" />
            <solid android:color="@android:color/black" />
            <corners android:radius="10dp"/>
        </shape>
    </item>
    <!--  the third <item> inner
          rectangle object in drawable-->
    <item>
        <shape android:shape="rectangle">
            <padding
                android:bottom="10dp"
                android:left="10dp"
                android:right="10dp"
                android:top="10dp" />
            <solid android:color="#03A9F4" />
            <corners android:radius="10dp"/>
        </shape>
    </item>

</layer-list>


0 commentaires

0
votes

Voici le fichier bouton_bg.xml que vous pouvez utiliser pour créer ce contexte: xxx

voici une image de prévisualisation:

Aperçu


0 commentaires