隐藏/显示工具栏

索伦亚

在我的应用程序中,当列表滚动时,我想隐藏/显示工具栏。我认为,我实现了以下链接中显示/隐藏的所有内容:

https://mzgreen.github.io/2015/06/23/How-to-hideshow-Toolbar-when-list-is-scrolling%28part3%29/

问题是,滚动列表时,工具栏没有移动/隐藏。

这是.xml的代码:

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeOverlay.AppCompat.ActionBar">

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="?attr/colorPrimary"
            android:minHeight="?attr/actionBarSize"
            app:layout_scrollFlags="scroll|enterAlways"
            app:titleTextColor="@android:color/white" />
    </android.support.design.widget.AppBarLayout>

    <se.emilsjolander.stickylistheaders.StickyListHeadersListView
        android:id="@+id/lvRef"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>

这里是依赖项:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'se.emilsjolander:stickylistheaders:2.7.0'
    compile 'com.android.support:recyclerview-v7:23.4.0'
    compile 'com.android.support:cardview-v7:23.4.0'
    compile 'com.android.support:design:23.4.0'
}
甘地

不幸的是,无法在ListView上进行嵌套滚动。请改用粘性标头RecyclerView。

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

显示隐藏工具栏项

来自分类Dev

在CoordinatorLayout上以编程方式隐藏/显示工具栏

来自分类Dev

显示隐藏的工具栏动画不流畅

来自分类Dev

Android工具栏,如何隐藏和显示片段

来自分类Dev

通过滚动按钮单击隐藏后显示工具栏

来自分类Dev

TinyMCE工具栏在单击时显示,在单击时隐藏

来自分类Dev

CoordinatorLayout并隐藏工具栏

来自分类Dev

工具栏不显示

来自分类Dev

ios8隐藏/显示导航栏和工具栏

来自分类Dev

工具栏显示在导航栏中

来自分类Dev

禁用/隐藏NestedList中的工具栏

来自分类Dev

滚动时Android“隐藏”工具栏

来自分类Dev

使用ListView Android隐藏工具栏

来自分类Dev

无法隐藏CakePHP DebugKit工具栏

来自分类Dev

软键盘隐藏工具栏

来自分类Dev

隐藏树状网格的分页工具栏

来自分类Dev

提名面板隐藏了工具栏

来自分类Dev

隐藏的工具栏中的绑定错误

来自分类Dev

隐藏插件中的工具栏条目

来自分类常见问题

隐藏显示浏览器图标的WebStorm工具栏

来自分类Dev

隐藏TabBar并在单击按钮时显示NavigationController工具栏

来自分类Dev

Ckeditor:按需显示和隐藏嵌入式工具栏

来自分类Dev

TINYMCE V3或V4在焦点/模糊上显示/隐藏工具栏

来自分类Dev

MediaController show()和hide()上的“隐藏和显示”工具栏

来自分类Dev

CoordinatorLayout:隐藏/显示一半可见的工具栏?

来自分类Dev

向上滚动android时自动隐藏或显示工具栏

来自分类Dev

打开某些片段时如何在工具栏上隐藏/显示图标

来自分类Dev

从工具栏菜单显示/隐藏特定项目无法正常运行

来自分类Dev

如何使用合理的快捷键显示/隐藏Firefox中的书签工具栏?

Related 相关文章

热门标签

归档