Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
263 views
in Technique[技术] by (71.8m points)

android - WebView not scrolling in API 30

I have a html file in WebView and it only contains text. It's not scrolling API 30 device(emulator). But it's scrolling other devices below api 30.

xml:

<WebView
        android:id="@+id/web_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" i tried match_parent and 0dp
        app:layout_constrainedHeight="true"
        android:layout_marginStart="@dimen/_20sdp"
        android:layout_marginTop="@dimen/_20sdp"
        android:layout_marginEnd="@dimen/_20sdp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@id/divider" />

I also tried:

           android:scrollbars="vertical" (xml)
           webView.isVerticalScrollBarEnabled = true (programatic)

and tried yo use FrameLayout or ScrollView but still it didn't work. By the way I load an asset file:

           webView.loadUrl("file:///android_asset/Agreement.html")

And this is example structure of html file:

    <html>
    <head>
    <title>Agreement</title>
    </head>
    <body>
    <p>some texts... with <i> tag sometimes.... there are 2 paragraph </p>
    </html>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...