Such a question is how to make a hexagon in xml? For example using shape. And can this be done?

The desired result should look like this:

enter image description here

  • 3
    Guys, there really is something under the text. Very similar to the hexagon! - vp_arth
  • @vp_arth It's just with rounded corners - Lucky_girl
  • @vp_arth and with a plus sign in the middle - Lucky_girl

1 answer 1

Transfer

The best solution would be to use VectorDrawable

Hexagon:

 <vector android:height="24dp" android:viewportHeight="628.0" android:viewportWidth="726.0" android:width="27dp" xmlns:android="http://schemas.android.com/apk/res/android"> <path android:fillColor="#00ffffff" android:pathData="m723,314c-60,103.9 -120,207.8 -180,311.8 -120,0 -240,0 -360,0C123,521.8 63,417.9 3,314 63,210.1 123,106.2 183,2.2c120,0 240,0 360,0C603,106.2 663,210.1 723,314Z" android:strokeColor="#000000" android:strokeWidth="4"/> </vector> 

For API support earlier Lollipop, you need to use VectorDrawableCompat instead of VectorDrawable

  • Oh, thank you very much! - Lucky_girl
  • @vp_arth you have everything in the php world there is different))) - Lucky_girl