我是靠谱客的博主 等待泥猴桃,最近开发中收集的这篇文章主要介绍android 滑动式菜单栏,Android导航栏滑动折叠效果,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

项目地址

https://github.com/oneAcorn/FoldNavScrollLayout

-------------------------------------------------------------------我是分割线---------------------------------------------------------------------

使用NestedScrollingParent实现的导航栏滑动折叠效果的ViewGroup

一 引用方法

1.在root build.gradle中加入

allprojects {

repositories {

...

maven { url 'https://jitpack.io' }

}

}

2.在项目的 build.gradle中加入

dependencies {

implementation 'com.github.oneAcorn:FoldNavScrollLayout:1.0'

}

二 使用方法

1.在xml中声明(FoldNavScrollLayout内的View只是示例,只要id是对的就行)

xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity">

android:id="@id/fold_nav_layout"

android:layout_width="match_parent"

android:layout_height="48dp"

android:background="#ffffff"/>

android:id="@id/fold_tab_layout"

android:layout_width="match_parent"

android:layout_height="34dp"

/>

android:id="@id/fold_content_layout"

android:layout_width="match_parent"

android:layout_height="match_parent"

/>

com.acorn.library.FoldNavScrollLayout>

请注意,FoldNavScrollLayout内第一层childView需要至少有3个如下id的View存在

resources>

作用分别是

fold_nav_layout 导航栏,拖动时根据方向显示/隐藏

fold_tab_layout 位置固定的View,不一定是TabLayout

fold_content_layout 可竖向滑动的View

2.完成,就当它是个LinearLayout,该怎么用就怎么用

项目地址

https://github.com/oneAcorn/FoldNavScrollLayout

最后

以上就是等待泥猴桃为你收集整理的android 滑动式菜单栏,Android导航栏滑动折叠效果的全部内容,希望文章能够帮你解决android 滑动式菜单栏,Android导航栏滑动折叠效果所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(57)

评论列表共有 0 条评论

立即
投稿
返回
顶部