gpt4 book ai didi

android - 滚动查看寻呼机内容时显示和隐藏操作栏

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:24:38 24 4
gpt4 key购买 nike

我想显示和隐藏操作栏/工具栏作为 Google Play 商店应用程序。我在顶部使用滑动选项卡并查看寻呼机来显示每个选项卡的内容。以下是 Google Play 商店应用的屏幕截图,以供引用:

enter image description here enter image description here

我的布局 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

这里有一个技巧。你需要:

  1. 将您的布局包装在 ListView 中
  2. 添加一个与操作栏大标题高度相同的假标题
  3. 将您的操作栏覆盖设置为 true
  4. 在列表移动时翻译真正的标题(即当假标题滚动时)。

一开始有点复杂,但一旦你理解了它,你就会发现它是多么的聪明和明显。我希望该链接将为您提供所需的一切。

我自己使用该链接在我自己的应用程序中实现它并且效果很好。

关于android - 滚动查看寻呼机内容时显示和隐藏操作栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26773245/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com