【发布时间】:2019-11-27 17:57:22
【问题描述】:
我在relative layout 有一些内容,可点击的imageview 隐藏/显示带有链接的textview 和带有内容的relative layout。我有这样的问题:当一个人不隐藏文本和相关布局时,我的 webview 在此内容下方可以轻松上下滚动,但是当此人隐藏 webview 上方的内容时,只能向下滚动并且可以' t 向上滚动。我看到this 问题,但我的webview 匹配父级,我认为它不会引起任何问题。也许我在其他地方有问题?
这是我的
xml模板:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:id="@+id/jobViewLayout"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:subtitleTextAppearance="@style/Toolbar.SubtitleText"
app:titleTextAppearance="@style/Toolbar.TitleText" />
</com.google.android.material.appbar.AppBarLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="7dp"
android:layout_marginTop="7dp"
android:layout_marginEnd="7dp"
android:layout_marginBottom="3.5dp"
android:background="@drawable/old_item">
<TextView
android:id="@+id/job_link"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/content_layout"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="54dp"
android:ellipsize="end"
android:singleLine="true"
android:textColor="@color/gray" />
<ImageView
android:id="@+id/hide_content"
android:layout_width="24dp"
android:layout_height="24dp"
android:layout_below="@id/content_layout"
android:layout_alignParentEnd="true"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
android:src="@drawable/ic_up_arrow"
android:contentDescription="hide btn" />
</RelativeLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/swipeContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="7dp"
android:layout_marginTop="3.5dp"
android:layout_marginEnd="7dp"
android:layout_marginBottom="7dp"
android:labelFor="@id/swipeContainer"
android:background="@color/white"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<my_package.jobAGENT.adapters.LollipopFixedWebView
android:id="@+id/webView"
android:labelFor="@id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
【问题讨论】: