NestedScrollWebView icon indicating copy to clipboard operation
NestedScrollWebView copied to clipboard

和CoordinatorLayout搭配使用时WebView的viewport大小不对

Open kutear opened this issue 3 years ago • 0 comments

image

比如上面的知乎的页面可以看到 WebView实际的高度不止屏幕中的那部分

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
    android:fitsSystemWindows="true">

    <com.google.android.material.appbar.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true">

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/web_act_toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:background="?attr/colorPrimary"
            app:contentInsetStartWithNavigation="56dp"
            app:layout_scrollFlags="scroll|enterAlways" />

        <com.google.android.material.progressindicator.LinearProgressIndicator
            android:id="@+id/web_act_progress_bar"
            android:layout_width="match_parent"
            android:layout_height="2dp"
            android:visibility="gone" />

    </com.google.android.material.appbar.AppBarLayout>

    <com.example.nestedscrollwebview.NestedScrollWebView
        android:id="@+id/web_act_webview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</androidx.coordinatorlayout.widget.CoordinatorLayout>

kutear avatar Jun 22 '21 17:06 kutear