如何解决WebView卡住滚动行为
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
tools:context=".Quotation_Activity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:paddingLeft="16dp"
android:paddingRight="16dp">
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/LightGrayColor"/>
<RelativeLayout
android:id="@+id/quotation_block"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true">
<TextView
android:id="@+id/quotation_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/quotation_no"
android:textAllCaps="true"
android:textSize="16sp"
android:fontFamily="sans-serif-medium"
android:textColor="@color/LightBlackColor"
android:layout_marginTop="32dp"
android:layout_gravity="center_horizontal"/>
<TextView
android:id="@+id/quotation_no_value"
android:layout_toEndOf="@id/quotation_txt"
android:layout_marginStart="4dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/_123"
android:textAllCaps="true"
android:textSize="16sp"
android:fontFamily="sans-serif-medium"
android:textColor="@color/LightBlackColor"
android:layout_marginTop="32dp"
android:layout_gravity="center_horizontal"
android:layout_toRightOf="@id/quotation_txt"
android:layout_marginLeft="4dp" />
</RelativeLayout>
<TextView
android:id="@+id/swipe_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/quotation_block"
android:layout_marginTop="@dimen/dimen_16dp"
android:layout_centerHorizontal="true"
android:text="@string/swipe_down_to_refresh"
android:gravity="center"
android:textSize="10sp"
android:visibility="visible"
android:layout_gravity="center"
tools:ignore="SmallSp" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/webview_border"
android:layout_below="@+id/swipe_txt"
android:layout_above="@id/button_block"
android:layout_marginTop="16dp" >
<WebView
android:id="@+id/webView"
android:backgroundTint="@android:color/transparent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/webview_border"
tools:ignore="UnusedAttribute"/>
<ProgressBar
android:id="@+id/loading"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"/>
</FrameLayout>
<LinearLayout
android:id="@+id/button_block"
android:layout_width="208dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="32dp"
android:orientation="horizontal"
android:baselineAligned="false">
<RelativeLayout
android:id="@+id/reject_btn"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center"
android:padding="8dp"
android:layout_marginRight="8dp"
android:layout_marginEnd="8dp"
android:background="@drawable/request_border"
android:layout_height="wrap_content">
<TextView
android:id="@+id/reject_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toEndOf="@id/cross_img"
android:text="@string/reject"
android:textAllCaps="true"
android:layout_marginStart="8dp"
android:textColor="@color/PrimaryTextColor"
android:textSize="12sp"
android:layout_toRightOf="@id/cross_img"
android:layout_marginLeft="8dp" />
<ImageView
android:id="@+id/cross_img"
android:layout_width="14dp"
android:layout_height="14dp"
android:scaleX="0.8"
android:scaleY="0.8"
android:src="@drawable/bluecross"
android:layout_centerVertical="true"
android:contentDescription="@string/todo"
app:tint="@color/colorPrimaryDark" />
</RelativeLayout>
<RelativeLayout
android:id="@+id/accept_btn"
android:layout_width="0dp"
android:layout_weight="1"
android:gravity="center"
android:padding="8dp"
android:background="@drawable/request_border"
android:layout_height="wrap_content">
<TextView
android:id="@+id/accept_txt"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:text="@string/accept"
android:textAllCaps="true"
android:textColor="@color/PrimaryTextColor"
android:textSize="12sp" />
<ImageView
android:layout_width="14dp"
android:layout_height="14dp"
android:src="@drawable/accept"
android:layout_centerVertical="true"
android:layout_toStartOf="@id/accept_txt"
android:contentDescription="@string/todo"
android:layout_marginRight="8dp"
android:layout_toLeftOf="@id/accept_txt"
android:layout_marginEnd="8dp" />
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
我的问题:-
我正在使用网络视图显示pdf。父级布局是整个xml acitvity的swipeRefreshLayout,而webview被包装在 frameLayout。我面临的问题与Webview的滚动行为有关。它夹在中间。请指导或提供解决此问题的建议。 .xml文件也已附加
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。