<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#eee"> <android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="480dp"> <android.support.design.widget.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed|snap">
<!--内容--> <LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#F5F6F9"
android:orientation="vertical"> <Space
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#ccc" /> <ImageView
android:id="@+id/imageView_banner"
android:layout_width="match_parent"
android:layout_height="50dp"
android:scaleType="fitXY" /> <LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="#fff"
android:gravity="center_vertical"> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="精选推荐" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="10dp"
android:text="不容错过的品牌呦"
android:textColor="#FC5A83"
android:textSize="10sp" /> </LinearLayout> <GridView
android:id="@+id/gridView_brand"
android:layout_width="match_parent"
android:layout_height="200dp"
android:background="#FBFDFA"
android:numColumns="3" /> <Space
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="#ccc" /> <GridView
android:id="@+id/gridView_shops"
android:layout_width="match_parent"
android:layout_height="90dp"
android:background="#FBFDFA"
android:numColumns="3" /> <Space
android:layout_width="match_parent"
android:layout_height="10dp"
android:background="#ccc" />
</LinearLayout> <!--利用toolbar 为模拟的toolbar和tablayout 进行占位,设置不收缩-->
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="80dp"
android:gravity="top"
android:minHeight="?attr/actionBarSize"
app:contentInsetEnd="0dp"
app:contentInsetLeft="0dp"
app:contentInsetRight="0dp"
app:contentInsetStart="0dp"
app:layout_collapseMode="pin">
<!--模拟toolbar部分-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#fff"
android:orientation="horizontal"> <ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/header_btn_noti_new" /> <TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center"
android:text="私密搭"
android:textSize="20sp" /> <ImageView
android:layout_width="50dp"
android:layout_height="50dp"
android:src="@drawable/header_btn_nocart" />
</LinearLayout>
</android.support.v7.widget.Toolbar>
<!--tablayout 部分-->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_gravity="bottom"
android:background="#fff"
android:orientation="horizontal"> <SearchView
android:layout_width="30dp"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:background="#fff" /> <android.support.design.widget.TabLayout
android:id="@+id/tabLayout_brand"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="bottom"
android:layout_weight="1"
android:background="#fff"
app:tabIndicatorColor="#000"
app:tabMode="scrollable"
app:tabTextColor="#ccc" />
</LinearLayout>
</android.support.design.widget.CollapsingToolbarLayout> </android.support.design.widget.AppBarLayout> <include layout="@layout/content_scrolling" />
<!--<android.support.v4.view.ViewPager-->
<!--android:id="@+id/viewpager_brand"-->
<!--android:layout_width="match_parent"-->
<!--android:layout_height="match_parent"-->
<!--app:layout_behavior="@string/appbar_scrolling_view_behavior" />-->
</android.support.design.widget.CoordinatorLayout>

  

CoordinatorLayout+TabLayout+ViewPager的更多相关文章

  1. TabLayout + ViewPager

    一.实现思路 1.在build.gradle中添加依赖,例如: compile 'com.android.support:support-v4:23.4.0'compile 'com.android. ...

  2. 使用FragmentTabHost+TabLayout+ViewPager实现双层嵌套Tab

    大多数应用程序都会在底部使用3~5个Tab对应用程序的主要功能进行划分,对于一些信息量非常大的应用程序,还需要在每个Tab下继续划分子Tab对信息进行分类显示. 本文实现采用FragmentTabHo ...

  3. 浅谈TabLayout(ViewPager+Tab联动)

    google发布了的Android Support Design库中提供了TabLayout 通过TabLayout+ViewPager实现导航栏效果,点击Tab ,ViewPager跟随变化,滑动V ...

  4. 介绍三个Android支持库控件:TabLayout+ViewPager+RecyclerView

    本文主要介绍如下三个Android支持库控件的配合使用: TabLayout:android.support.design.widget.TabLayout ViewPager:android.sup ...

  5. [置顶] xamarin Tablayout+Viewpager+Fragment顶部导航栏

    最近几天不忙,所以把项目中的顶部导航栏的实现归集一下.android中使用TabLayout+ViewPager+Fragment制作顶部导航非常常见,代码实现也比较简单.当然我这个导航栏是基于xam ...

  6. Android开发之漫漫长途 Fragment番外篇——TabLayout+ViewPager+Fragment

    该文章是一个系列文章,是本人在Android开发的漫漫长途上的一点感想和记录,我会尽量按照先易后难的顺序进行编写该系列.该系列引用了<Android开发艺术探索>以及<深入理解And ...

  7. ViewPagerWithRecyclerDemo【RecyclerView+ViewPager实现类似TabLayout+ViewPager效果】

    版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 使用RecyclerView+ViewPager实现类似TabLayout+ViewPager效果. 效果图 使用步骤 一.项目组织 ...

  8. 安卓TabLayout+ViewPager实现切页

    安卓使用TabLayout+ViewPager+Fragment 实现页面切换,可实现左右滑动切换视图界面和点击切换 可自定义菜单栏是在顶部还是在底部 一.实现效果: 二.实现过程: 2.1 一些重要 ...

  9. TabLayout+ViewPager 标题不显示问题

    第一次用TabLayout+ViewPager 组合在布局中写好了三个标题预览没问题而且也设置了 app:tabIndicatorColor="@color/colorAccent" ...

随机推荐

  1. Java应用程序访问网络资源--HttpClient

    HttpClient的最本质的功能是执行HTTP方法.一个HTTP方法的执行涉及到一个或几个HTTP请求/ HTTP响应的交流,通常由HttpClient的内部处理.用户预计将提供一个请求对象来执行和 ...

  2. Oracle11g导出空表

    # Oracle11g导出空表 <!-- create time: 2015-06-01 23:35:24 --> ###原因 11G中有个新特性,当表无数据时,不分配`segment`, ...

  3. Ms sql行转列。汇总

    SQL行转列汇总 PIVOT 用于将列值旋转为列名(即行转列),在 SQL Server 2000可以用聚合函数配合CASE语句实现 PIVOT 的一般语法是:PIVOT(聚合函数(列) FOR 列 ...

  4. 织梦系统“当前位置”{dede:field.position}的修改方法

    dedecms中修改当前位置{dede:field.position},就是只要首页>一级栏目>二级栏目这样.找到include/typelink.class.php,找到这个文件里的这个 ...

  5. ReactJS学习笔记(一)

    1.依赖的资源: <script type="text/javascript" src='../asset/react.js'></script>   &l ...

  6. Xmodem Bootloader

    了解更多关于bootloader 的C语言实现,请加我QQ: 1273623966 (验证信息请填 bootloader),欢迎咨询或定制bootloader(在线升级程序). 多年前玩Cisco交换 ...

  7. Mac Aria2 使用Privoxy将socks代理转化为http代理

    安装Privoxy 打开终端安装privoxy来实现这里我是通过brew来进行的安装 brew install privoxy 看到这行已经安装成功 ==> Caveats To have la ...

  8. XML.04-dom4j和XPath

    body,td { font-family: calibri; font-size: 10pt } XML.04-dom4j和XPath dom4j的基本使用 XPath 啥是XPath XPath语 ...

  9. 深入jQuery中的data()

    引入 data函数在jQuery中看起来很不起眼, 就像沙滩上一颗平凡的沙子, 但仔细一瞅, 却惊讶的发现data是jQuery中无比重要的一环, 甚至jQuery中各种事件都基于此. data有什么 ...

  10. SQL Server 数据库的维护(二)__触发器

    --维护数据库-- --触发器-- --概述: 触发器是一种特殊类型的存储过程,用来强制执行业务规则.在调用执上,触发器不能像存储过程那样可以由用户通过T-SQL语句直接调用,而是需要有数据库所发生的 ...