how to build this custom view?

0

How can I build this view, if theoretically every buton is an image, but it is clear that the default images are square, so it would not work, does it occur to them how could the view be created?

    
asked by Gilberto Ibarra 26.10.2016 в 07:44
source

1 answer

2

Good Gilberto,

In the res/drawable/ folder of your project, you can define styles and figures using an xml file. For example:

<?xml version="1.0" encoding="UTF-8"?> 
<shape xmlns:android="http//schemas.android.com/apk/res/android"
   android:shape="hexagon">
 <solid android:color="#ffffffff" />
 <size android:width="60dp"
    android:height="40dp" />
</shape>

This example would create a hexagon like the one above, then in the layout where you have the Button you can define the style created by android:background="@drawable/mi_estilo".

Here you have a link to see all the properties you can give to the figures and styles.

I hope it helps you more or less where to throw.

Greetings!

    
answered by 26.10.2016 в 09:12