Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kutear opened this issue Jun 22, 2021 · 0 comments
Open

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

kutear opened this issue Jun 22, 2021 · 0 comments

Comments

@kutear
Copy link

kutear commented Jun 22, 2021

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant