Android 片段父布局透明

Android 片段父布局透明,android,android-fragments,transparency,Android,Android Fragments,Transparency,我使用circularRevealAnimation启动一个片段。这是它的布局 <?xml version="1.0" encoding="utf-8"?> <io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/main_container" android:background="@color/red"

我使用
circularRevealAnimation
启动一个片段。这是它的
布局

<?xml version="1.0" encoding="utf-8"?>
<io.codetail.widget.RevealFrameLayout  xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/main_container"
android:background="@color/red"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
    android:id="@+id/container2"
    android:layout_width="match_parent"
    android:background="@color/white"
    android:layout_height="match_parent"
    android:orientation="vertical">

   ....

</LinearLayout>

</io.codetail.widget.RevealFrameLayout>
如您所见,当其子布局为白色时,父布局为红色。当我开始这个
片段时
我可以看到红色背景上的白色圆形凹面,当我想看到前面片段上的动画时。我怎样才能做到这一点


在阅读SOF相关主题时,我试图使
background=“@null”等等。什么都帮不了我。那么,将
Fragment
parent
layout
设置为
transparent`的写入方式是什么呢?

您可以像这样使用xml实现

android:background="@android:color/transparent" 
yourview.setBackgroundColor(Color.parseColor("#00000000"));
或者在程序上你可以这样改变

android:background="@android:color/transparent" 
yourview.setBackgroundColor(Color.parseColor("#00000000"));

这是我的错。我的容器是
LinearLayout
,而不是
FrameLayout
。因为没有透明度

它不起作用。像许多不同的方式一样,它使背景变白。setAlpha使其透明?@mjsam它使所有布局透明,所以我看不到下一个片段