具有透明背景的图像在android studio中开始有一个

问题描述

我正在尝试将android studio中具有透明背景的图像添加一个新的空项目中,但是当我添加它时,它一直为我提供透明背景作为背景

Here's the image I'm trying to add

Here's what keeps happening

我尝试了许多其他图像,但是同一件事不断发生,我在网上看了一下,但是我发现的是如何使图像本身透明或半透明,而不是背景

如果有帮助,这是xml文件中的代码

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="com.ahmad.connectfour.MainActivity">

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageView3"
    app:srcCompat="@drawable/eye"
    android:layout_alignParentTop="true"
    android:layout_alignParentLeft="true"
    android:layout_alignParentStart="true" />

</RelativeLayout>

根本不编辑Java文件

解决方法

使用此眼睛图标:

enter image description here

访问该链接以获取更多图标:https://material.io/resources/icons/?icon=check_circle_outline&style=baseline