【发布时间】:2017-11-30 08:45:40
【问题描述】:
我必须在向上滚动时隐藏底部导航视图并在向下滚动时显示。如何实现这个? 我的布局是这样的
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_above="@+id/navigation"
android:layout_alignParentTop="true"
android:layout_marginBottom="5dp">
<FrameLayout
android:id="@+id/container1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
</LinearLayout>
<android.support.design.widget.BottomNavigationView
android:id="@+id/navigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="?android:attr/windowBackground"
app:layout_scrollFlags="scroll|enterAlways|snap"
app:menu="@menu/dashboard_slider_menu" />
</RelativeLayout>
我附上了视图的截图。请检查一下。
【问题讨论】:
-
你尝试了什么?
-
在您的列表视图/回收器视图中添加事件/手势监听器。根据事件隐藏/显示。
-
R u 使用 RecyclerView
-
ya.. 我正在使用 recyclerview
-
@KarthikThunga 在下面查看我的答案
标签: android android-layout android-fragments bottomnavigationview