【发布时间】:2018-06-05 15:13:11
【问题描述】:
我的应用程序上有 WebView,并且在膨胀 WebView 片段时,我在 android 7.0 上从用户那里收到了许多相同的错误。
错误日志:
android.view.InflateException: Binary XML file line #8: Binary XML file line #8: Error inflating class android.webkit.WebView 原因:android.view.InflateException: Binary XML file line #8: Error inflating class android.webkit.WebView
WebView 片段布局:
<android.support.v7.widget.LinearLayoutCompat
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background">
<WebView
android:id="@+id/wvAparat"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="16dp" />
</android.support.v7.widget.LinearLayoutCompat>
我从这些设备收到此错误:
SM-G950F 安卓 7.0
SM-J330F Android 7.0
Moto E (4) Plus Android 7.1.1
【问题讨论】:
-
可能是错误原因是
android.support.v7.widget.LinearLayoutCompat它与webview无关 -
@Tej 也许,我会测试一下。
-
@VolkanSahin45 No error is clear android view InflateException.
-
尝试使用 LinearLayout 而不是
android.support.v7.widget.LinearLayoutCompat
标签: android android-layout webview android-webview inflate-exception