自定义显示效果显示在网络视图下方,Android不显示网络视图

自定义显示效果显示在网络视图下方,Android不显示网络视图,android,webview,circularreveal,Android,Webview,Circularreveal,我用的是圆形图书馆(ttps://github.com/ozodrukh/CircularReveal)要在包含web视图的活动中显示视图,此动画可以正常工作,但它在web视图下方绘制。WebView不会与其父视图一起显示,当我向WebView添加一些动画时,这将取消循环显示动画 <?xml version="1.0" encoding="utf-8"?> <io.codetail.widget.RevealFrameLayout xmlns:android="http://s

我用的是圆形图书馆(ttps://github.com/ozodrukh/CircularReveal)要在包含web视图的活动中显示视图,此动画可以正常工作,但它在web视图下方绘制。
WebView
不会与其父视图一起显示,当我向
WebView
添加一些动画时,这将取消循环显示动画

<?xml version="1.0" encoding="utf-8"?>
<io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/myLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.CardView
            android:id="@+id/myCard"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cardUseCompatPadding="true"
            app:contentPadding="5dp">

            <WebView
                android:id="@+id/myWeb"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </android.support.v7.widget.CardView>

    </LinearLayout>

</io.codetail.widget.RevealFrameLayout>



<?xml version="1.0" encoding="utf-8"?>
<io.codetail.widget.RevealFrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <LinearLayout
        android:id="@+id/myLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <android.support.v7.widget.CardView
            android:id="@+id/myCard"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:cardUseCompatPadding="true"
            app:contentPadding="5dp">

            <WebView
                android:id="@+id/myWeb"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

        </android.support.v7.widget.CardView>

    </LinearLayout>

</io.codetail.widget.RevealFrameLayout>

一种可能的解决方法是使用AnimatorListener切换WebView的可见性:

WebView webView = ...

Animator circularReveal = ViewAnimationUtils.createCircularReveal( ... )
circularReveal.addListener(new Animator.AnimatorListener() {

    @Override
    public void onAnimationStart(Animator animator) {
        webView.setVisibility(View.INVISIBLE)
    }

    @Override
    public void onAnimationEnd(Animator animator) {
        webView.setVisibility(View.VISIBLE)
    }
}

我认为您复制了xml。同一个XML中不能有两个根视图您是否尝试将
WebView
height
设置为
match\u parent
@Darpan您找到解决方案了吗?