androideveloper 2015-10-20 02:55 采纳率: 50%
浏览 8801
已结题

CoordinatorLayout+NestedScrollView + webview 。

想监听webview滚动 CoordinatorLayout+NestedScrollView 用NestedScrollView 包裹webview 无法让webview位于topbar下方。原本应该可以在下方,但是提示包裹webview的NestedScrollView height必须fillparent。所以webview沾满了屏幕topbar相当于一个fragment一样盖在了webview上挡住了一些东西

想要的效果就是正常的webview在topbar下方 布局如下:

 <?xml version="1.0" encoding="utf-8"?>

<CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >

    <RelativeLayout
        android:id="@+id/rl_content"
        android:layout_width="match_parent"
        android:layout_height="fill_parent">
        <android.support.v4.widget.NestedScrollView
            app:layout_behavior="@string/appbar_scrolling_view_behavior"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            >
    <WebView
        android:id="@+id/action_webkit"
        android:layout_width="match_parent"
        android:layout_height="fill_parent"
         />
        </android.support.v4.widget.NestedScrollView>

    <ProgressBar
        android:id="@+id/progressBar"
        style="?android:attr/progressBarStyleHorizontal"
        android:layout_width="match_parent"
        android:layout_height="6dp"
        android:progressDrawable="@drawable/progress_drawable" />
    </RelativeLayout>
    <android.support.design.widget.AppBarLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <include layout="@layout/top_bar"
            app:layout_scrollFlags="scroll|enterAlways"
            android:id="@+id/top"/>

    </android.support.design.widget.AppBarLayout>
。。</CoordinatorLayout>
  • 写回答

2条回答 默认 最新

  • Robot-S 2015-10-20 03:11
    关注

     
    WebView是一个专门用来显示网页的View子类。它使用WebKit渲染引擎来显示网页,并且支持包括前进,后退,放大,缩小,文本搜索等多种功能。
    WebView有一个辅助类叫WebSettings,它管理WebView的设置状态。该类的对象可以通过WebView.getSettings()方法获得。下面我们介绍几个常用的WebSettings设置:
    view plainp......
    答案就在这里:WebView
    ----------------------Hi,地球人,我是问答机器人小S,上面的内容就是我狂拽酷炫叼炸天的答案,除了赞同,你还有别的选择吗?

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog