Multiple images inside an Image Button with padding

1

I have a ImageButton and within the same I need to put 5 images at the same time, one being in the center and the others around, alluding to being expanding.

So how do I put all the images at the same time in ImageButton and between them put a padding or different sizes?

    
asked by anonymous 11.02.2016 / 19:26

2 answers

1

Given that an Image Button has a UMA source, it is best to edit the image in its own software and then define the new image as the source of the button.

If you need to create effects, you will need to have multiple images to display at different times.

    
11.02.2016 / 19:35
1

You can create a <layer-list> with multiple circles inside, using the dashGap and dashWidht attribute and set to src of your ImageView :

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape android:shape="oval">
            <solid android:color="@android:color/transparent" />
            <padding
                android:bottom="40dp"
                android:left="40dp"
                android:right="40dp"
                android:top="40dp" />
            <stroke
                android:width="1dp"
                android:color="@android:color/holo_red_dark"
                android:dashGap="3dp"
                android:dashWidth="2dp" />
        </shape>
    </item>
    <item>
        <shape android:shape="oval">
            <solid android:color="@android:color/transparent" />

            <padding
                android:bottom="40dp"
                android:left="40dp"
                android:right="40dp"
                android:top="40dp" />
            <stroke
                android:width="1dp"
                android:color="@android:color/holo_red_dark"
                android:dashGap="3dp"
                android:dashWidth="2dp" />
        </shape>
    </item>
    <item>
        <shape android:shape="oval">
            <solid android:color="@android:color/transparent" />

            <padding
                android:bottom="40dp"
                android:left="40dp"
                android:right="40dp"
                android:top="40dp" />
            <stroke
                android:width="1dp"
                android:color="@android:color/holo_red_dark"
                android:dashGap="3dp"
                android:dashWidth="2dp" />
        </shape>
    </item>
    <item>
        <shape android:shape="oval">
            <solid android:color="@android:color/transparent" />

            <size
                android:width="40dp"
                android:height="40dp" />
            <stroke
                android:width="1dp"
                android:color="@android:color/holo_red_dark"
                android:dashGap="3dp"
                android:dashWidth="2dp" />
        </shape>
    </item>
</layer-list>

Result:

    
11.02.2016 / 21:25