【发布时间】:2015-09-18 05:51:50
【问题描述】:
我正在使用 Circular Reveal Library (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>
【问题讨论】:
-
我认为你复制了你的 xml。同一个 xml 中不能有两个根视图
-
你试过将
WebView的height设置为match_parent -
@Darpan 你找到解决方案了吗?
标签: android webview circularreveal