Android网页查看滚动问题



我试图使webView高度为wrap_content,并用于滚动外部滚动视图。但在我的情况下,只滚动webView和其他放在下面的视图,没有显示。我需要在webView下方显示复选框和按钮。这是我的布局。可能有某种方法可以禁用webView内部的滚动?有人想做这样的事吗?

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:orientation="vertical"
android:paddingEnd="8dp"
android:paddingStart="8dp">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:gravity="center"
android:text="@string/signup_title_complete_registration"
android:textColor="?android:textColorPrimary"
android:textSize="24sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:ellipsize="end"
android:gravity="center"
android:text="@string/signup_subtitle_complete_registration"
android:textColor="?android:textColorPrimary"
android:textSize="14sp" />
<WebView
android:id="@+id/disclosureWv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible" />
<CheckBox
android:id="@+id/chekBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="32dp"
android:background="?selectableItemBackground"
android:button="@null"
android:checked="@={viewModel.agree}"
android:drawableEnd="?android:listChoiceIndicatorMultiple"
android:ellipsize="end"
android:gravity="start|center"
android:maxLines="4"
android:paddingBottom="10dp"
android:paddingTop="10dp"
android:text="@string/signup_title_agreement_checkbox"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/buttonContainer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:padding="8dp">
<Button
android:id="@+id/previousBtn"
style="@style/Button.White.BlueStroke"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:onClick="@{() -> viewModel.onPreviousClicked()}"
android:text="@string/general_button_previous_step"
android:textColor="?android:textColorTertiaryInverse"
android:textSize="16sp" />
<Button
android:id="@+id/nextBtn"
style="@style/Button.Positive"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_weight="1"
android:enabled="@{viewModel.enabled}"
android:onClick="@{() -> viewModel.onNextClicked()}"
android:text="@string/general_button_next"
android:textSize="16sp" />
</LinearLayout>
</LinearLayout>
</ScrollView>

我怎样才能达到这种行为?

WebView内容仅在模拟器上进行了修剪。当我在真正的设备上构建应用程序时,一切都变得很好

最新更新