black edges on shapeable imageview after corner round
Asked Answered
S

2

6

After rounding the edges on my shapeable image view, I still get black edges around the rounded edges
Image with black edges

Here is my xml :

<com.google.android.material.imageview.ShapeableImageView
    android:id="@+id/shapeableImageView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/background"
    android:scaleType="fitXY"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent"
    app:shapeAppearance="@style/article_shape" />
Slr answered 15/6, 2021 at 23:10 Comment(3)
Do you please add code of your @style/article_shape?Stile
One of the parents has a black blackground.Johns
This is the code for my style <style name="article_shape"> <item name="cornerSizeTopLeft">20dp</item> <item name="cornerFamilyTopLeft">rounded</item> <item name="cornerSizeBottomRight">10dp</item> <item name="cornerFamilyBottomRight">rounded</item>Slr
S
2

app:shapeAppearanceOverlay="@style/article_shape" actually worked. The black edges will not reflect when you run on an emulator or a device. Thanks

Slr answered 16/6, 2021 at 11:49 Comment(1)
But when I take a screenshot via code, it still shows the black background in the bg of the bitmapDope
G
1

Check the Androidanifest.xml file in the Application section of the hardwareAccelerated setting:

android:hardwareaccelerated="true"
Garlan answered 17/11, 2022 at 13:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.