Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/181.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在android studio中创建透明的png ImageView_Android_Imageview_Transparent - Fatal编程技术网

如何在android studio中创建透明的png ImageView

如何在android studio中创建透明的png ImageView,android,imageview,transparent,Android,Imageview,Transparent,我想让我的图像看起来透明,所以我决定把破碎的图像变成png。然后我试了一下。但它失败了 而不是这个 破损的png xml 看起来像这样 破png黑 这是我的xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android

我想让我的图像看起来透明,所以我决定把破碎的图像变成png。然后我试了一下。但它失败了

而不是这个 破损的png xml

看起来像这样 破png黑

这是我的xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/broken"
         android:alpha=".75">

试试这个不确定这是你想要的

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:background="@android:color/white"
    android:layout_height="wrap_content">

    <ImageView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/broken"/>

</RelativeLayout>

如果不能满足您的需要,请告诉我

添加白色背景的家长

e、 g


你能将png作为文件发布吗?你的主题使用黑色背景吗?很可能是因为你使用的是黑色主题。谢谢你的回答,但它不起作用。现在全黑了。我想这是因为我的黑暗主题。
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:fab="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white">

<RelativeLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/broken"
    android:alpha=".75">


<YOUR CODE>


</FrameLayout>