following up on this answer, how can i achieve the same but including a border that runs smoothly around the clipped ImageView
.
I have tried using this as a background drawable for the ImageView
with red borders and imageView.setClipToOutline(true)
.
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<corners
android:radius="35" />
<stroke
android:width="2dp"
android:color="#E42323" />
<padding
android:bottom="2dp"
android:left="2dp"
android:right="2dp"
android:top="2dp" />
</shape>
when not using an image as Android:src
it works fine.
but when i use Android:src
the borders are clipped as well.
note: I know one can use a FrameLayout
with ImageView
as a child and set the background drawable to the FrameLayout
but that's just asking for issues.