siyamed / android-shape-imageview

Custom shaped android imageview components
MIT License
2.67k stars 599 forks source link

border for PorterShapeImageView #72

Open feidi2014 opened 7 years ago

feidi2014 commented 7 years ago

I tried this

<com.github.siyamed.shapeimageview.mask.PorterShapeImageView
                    android:id="@+id/ivPriceBackgroundMask"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:alpha="0.65"
                    android:scaleType="centerCrop"
                    android:src="@color/black"
                    app:siBorderColor="@color/white"
                    app:siBorderWidth="1dp"
                    app:siShape="@drawable/bg_merchandise_price_item_box"
                    app:siSquare="true" />

bg_merchandise_price_item_box.xml

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
    <item>
        <shape xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">
            <solid android:color="@color/black" />
            <corners
                android:bottomLeftRadius="@dimen/common_padding_small1"
                android:bottomRightRadius="0dp"
                android:topLeftRadius="@dimen/common_padding_small1"
                android:topRightRadius="0dp" />
            <stroke
                android:width="1dp"
                android:color="@color/white" />
        </shape>
    </item>
</layer-list>

but no border is shown up. any idea?

Fatimamostafa commented 6 years ago

same issue. Did you solve it? @feidi2014