Skip to content Skip to sidebar Skip to footer

Show Imageview In Android Studio Without White Background

I have a transparent image and when I add in my imageview it appears like this [output image 1] but I want to remove the white color of the image .I need only the carin the image t

Solution 1:

Use transparent background for ImageView like below:

<LinearLayoutandroid:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"><ImageViewandroid:background="@android:color/transparent"android:id="@+id/category_item"android:layout_width="90dp"android:layout_height="90dp"android:layout_gravity="center"
     /><TextViewandroid:id="@+id/cat_name"android:layout_width="match_parent"android:layout_height="match_parent"android:layout_margin="10sp"android:layout_gravity="center_horizontal"android:textColor="@color/dark_grey_two"android:textSize="12sp"/></LinearLayout>

Solution 2:

You could try this layout attribute inside your LinearLayout :

android:background="@android:color/transparent"

This will hide the background color and the white should not be visible anymore.

Give it a shot and let us know if this was helpful.

Solution 3:

you should make the background of your image transparent by adding background attribute to your Imageview.

<ImageView
    android:id="@+id/category_item"
    android:layout_width="90dp"
    android:layout_height="90dp"
    android:layout_gravity="center"
    android:background="@android:color/transparent" 
    />    

This will change the default white color background of the image in android studio

Post a Comment for "Show Imageview In Android Studio Without White Background"