android - Webview 不是可滚动的android
问题描述
我在 有一些内容relative layout
,并且可以点击,这些内容通过链接和内容imageview
隐藏/显示。我有这样的问题:当一个人不隐藏文本和相关布局时,我下面的这个内容可以很容易地上下滚动,但是当这个人隐藏上面的内容时,只能向下滚动而不能向上滚动。我看到了这个问题,但是我的匹配父母并不会引起我认为的任何问题。也许我在另一个地方有问题?textview
relative layout
webview
webview
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>
解决方案
你为什么用那个<de.jobnetzwerk.jobnet.jobAGENT.adapters.LollipopFixedWebView/>
改为使用WebView
它会正常工作
<WebView
android:id="@+id/webView"
android:layout_width="match_parent"
android:layout_height="match_parent" />
推荐阅读
- python-3.x - 代码不检查输入的答案是否正确
- android - 在自定义视图中膨胀布局后输入事件异常
- python - 在 3 个文本文件之间写入正数和负数
- ios - AudioKit 4.6 没有声音
- c# - 如何从 XML 文件中的 ListBox 中删除所选节点
- php - 浏览器是否尊重 php 的 WWW-Authenticate 标头中的领域字符串?
- java - 我总是得到“{“status”:504,“error”:“Gateway Timeout”,“message”:“com.netflix.zuul.exception.ZuulException:Hystrix Readed time out”}”?
- javascript - 更换幻灯片后如何更换音源?
- javascript - 为什么我的函数没有在我的 SetInterval 中被调用?
- python - 有没有办法将 2 段非常相似的代码变成一个函数并重复?