vinc3m1 / RoundedImageView

A fast ImageView that supports rounded corners, ovals, and circles.
Other
6.44k stars 1.25k forks source link

setting relativelayout background makes the roundedimage black #191

Closed morkuk closed 6 years ago

morkuk commented 7 years ago

First, thank you for making this rounded image, it's the best i've seen. Unfortunately, when I add a background to my RelativeLayout, the Imageview suddenly colored black.

image

code: `<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@drawable/pexelsphoto57645"

<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true"
   >

    <com.makeramen.roundedimageview.RoundedImageView
        android:id="@+id/opening_view"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        android:src="@drawable/pexelsphoto26208"
        android:scaleType="fitXY"
        android:adjustViewBounds="true"
        app:riv_corner_radius="30dip"
        app:riv_border_width="1dip"
        android:layout_centerHorizontal="true"
        app:riv_border_color="@color/light_grey"
        app:riv_mutate_background="true"
        android:layout_height="wrap_content"
        android:layout_width="wrap_content"
        />

    <danielandmor.drivediaryapp.StrokeTextView
        android:id="@+id/opening_text"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:textColor="@color/white"
        android:text="textview"
        android:textSize="15sp"
        android:textStyle="bold"
        android:layout_centerHorizontal="true"
        android:gravity="center"
        android:padding="7dp"
        />

    <Button
        android:id="@+id/todolist"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="textview"
        android:textSize="25sp"
        android:padding="10dp"
        android:textColor="@color/white"
        android:background="@drawable/round_rect_shape"
        android:layout_below="@+id/opening_view"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="10dp"
        />

    <!-- ad
    <com.google.android.gms.ads.AdView
        android:id="@+id/adView"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:layout_alignParentEnd="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true" />-->
</RelativeLayout>

</RelativeLayout>`

EDIT: when I don't use a background or I am using simple color it's okay: `<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:background="@color/red"

... `

image

XPGSnail commented 7 years ago

i got the same problem,so did you solve it?@morkuk

Damonzh commented 7 years ago

@XPGSnail i change the parent to FrameLayout, this problem disappeared