滚动查看寻呼机内容时显示和隐藏操作栏
问题描述:
我想显示和隐藏操作栏/工具栏作为Google Play商店应用程序。我在顶部使用滑动标签并查看分页器以显示每个标签的内容。这是谷歌Play商店应用的参考截图:滚动查看寻呼机内容时显示和隐藏操作栏
我的布局XML:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_height="match_parent">
<LinearLayout style="@style/HeaderBar"
android:id="@+id/headerbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<include layout="@layout/toolbar_no_bg"
android:id="@+id/toolbar_actionbar"/>
<com.fauzie.sample.tabsspinner.widget.SlidingTabLayout
android:background="@color/tab_background"
android:id="@+id/sliding_tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<android.support.v4.view.ViewPager
android:id="@+id/view_pager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/headerbar">
</android.support.v4.view.ViewPager>
</RelativeLayout>
在此先感谢。
答
看一看这样的:
https://github.com/flavienlaurent/NotBoringActionBar
这里还涉及到一个把戏。你需要:
- 列表视图裹布局
- 具有相同高度添加一个假头为你的动作条大标题
- 你的动作条重叠设置为true
- 翻译当列表移动时(即,假滚动条滚动时)的真实标题。
起初有点复杂,但一旦你明白了,就会明白它有多聪明和明显。链接将给你我需要的所有东西。
我自己使用该链接来实现它在我自己的应用程序,它的效果很好。
答
+0
这就是我正在寻找的! – 2015-07-28 09:16:33
看到这个[答案] (http://stackoverflow.com/a/30962301/1576416) – 2015-07-09 08:03:47