Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to build a trapezoid shape in android?

how can I create a trapezoid shape like below image ?

enter image description here

I don't want to use an image or 9.png .

like image 804
S.M_Emamian Avatar asked Sep 10 '14 14:09

S.M_Emamian


1 Answers

Try this:

<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="292dp"
    android:height="172dp"
    android:viewportWidth="292"
    android:viewportHeight="172">

    <path
        android:strokeWidth="1.5"
        android:strokeMiterLimit="10"
        android:pathData="M 27.046 96.615 L 16.416 150.396 L 271.534 150.396 L 186.495 22.836 L 37.676 22.836 L 27.046 86.615 Z" />

    <path
        android:fillColor="#00ff00"
        android:strokeWidth="1.5"
        android:strokeMiterLimit="10"
        android:pathData="M 16.046 20.615 L 13.416 150.396 L 271.534 150.396 L 186.495 22.836 L 37.676 22.836 L 16.046 23.615 Z " />
</vector>

enter image description here

like image 138
Suhayl SH Avatar answered Sep 16 '22 20:09

Suhayl SH