折叠Tab

作者: 小慧sir | 来源:发表于2019-09-26 18:56 被阅读0次
<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".MainActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:fitsSystemWindows="true"
        app:theme="@style/ToolbarTheme">
        <!--app:layout_scrollFlags="scroll|enterAlways"-->
        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsingToolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:contentScrim="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:navigationIcon="@mipmap/timg">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:fitsSystemWindows="true"
                android:orientation="vertical"
                android:scaleType="centerInside"
                app:layout_collapseMode="parallax">

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:background="@mipmap/timg1" />
            </LinearLayout>

            <android.support.v7.widget.Toolbar
                android:id="@+id/bar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="#00ffffff"
                android:gravity="center_vertical"
                app:layout_collapseMode="pin"
                app:navigationIcon="@mipmap/back"
                app:popupTheme="@style/AppTheme.PopupOverlay"
                app:theme="@style/ToolbarTheme"
                app:titleTextColor="#ffffff" />


        </android.support.design.widget.CollapsingToolbarLayout>

        <android.support.design.widget.TabLayout
            android:id="@+id/tl"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="#0ff"
            app:tabIndicatorColor="#666666"
            app:tabSelectedTextColor="#e21717"
            app:tabTextColor="#4D4D4D" />
    </android.support.design.widget.AppBarLayout>

    <android.support.v4.view.ViewPager
        android:id="@+id/vp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:layout_behavior="@string/appbar_scrolling_view_behavior" />

</android.support.design.widget.CoordinatorLayout>

相关文章

  • 折叠Tab

  • Web端---常用的特效

    1. tab列表折叠效果 html: 能源系统事业部 岗位名称: 工作地点 岗位名...

  • CSS样式--浮动float

    一、标准文档流的特性 1)空白折叠现象 无论多少个空格、换行、tab都会折叠为一个空格,比如我们想让img标签之间...

  • 空白折叠

    空白折叠 在源代码中的连续空白字符(空格、换行、制表符tab),在页面显示时,会被折叠为一个空格。 在 元素中的内...

  • 自定义behavior 实现联动动画效果

    最近看到很多app实现动画很好看,支持下拉刷新放大,上滑折叠,而且下半部分还是一个Tab+Viewpager布局,...

  • angular代码片段

    【tab路由传参】 【定时器间隔调用以及清除】 【angular操作dom一键复制功能】 【展开一项的折叠面板】

  • MarkDown 创建目录

    创建类似于书本目录层级 通过 "-"来实现 \tab -\tab \tab -\tab \tab \tab - 如...

  • Tab 你用对了吗?

    Tab是什么? 在macOS 中的Tab 在android中的Tab 在iOS中的Tab 在网页中的Tab 本文主...

  • Linux帮助命令man的使用

    1. 常用操作 [tab][tab]:显示所有命令 [First][tab][tab]:显示以[First]开头的...

  • MAC下Chrome常用快捷键

    切换tab control + shift + tab 向前切换 control + tab 向后切换

网友评论

      本文标题:折叠Tab

      本文链接:https://www.haomeiwen.com/subject/dvckuctx.html