[Solved] create an image view in android with arbitrary shape [duplicate]


You can achieve the described background by below code.

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@color/colorPrimary"/>
    <item>
        <bitmap android:src="https://stackoverflow.com/questions/49953217/@drawable/your-drawable" android:gravity="center" android:alpha="0.1"/>
    </item>

    <item android:top="300dp"
      android:bottom="-300dp"
      android:left="0dp"
      android:right="-300dp">
        <rotate
          android:fromDegrees="-10"
          android:pivotX="0%"
          android:pivotY="100%">
            <shape
              android:shape="rectangle">
                <solid
                  android:color="?android:colorBackground"/>
            </shape>
        </rotate>
    </item>
</layer-list>

4

solved create an image view in android with arbitrary shape [duplicate]