<?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. 11,SFDC 管理员篇 - 报表和数据的可视化

    1,Report Builder 1,每一个report type 都有一个 primay object 和多个相关的object 2,Primary object with related obje ...

  2. linux ssh publickey登录

    一.公钥认证的基本思想: 对信息的加密和解密采用不同的key,这对key分别称作private key和public key,其中,public key存放在目标服务器上,而private key为特 ...

  3. oracle number型日期转date型日期

    在搞数据库时,发现有这样的一个字段,类型是NUMBER(38),查看了一下里面的数据,都是这样的, 13239576781141321326994295132212930680413221297162 ...

  4. MATLAB 文件对话框之图片格式转换

    localpathname为当前路径,需要保存图片的位置,根据自己的实际路径设置,usedpathname用来保存打开的文件位置,方便下次打开文件对话框以上次的路径为默认路径. global used ...

  5. Activity has leaked window that was originally added

    错误: E/WindowManager: android.view.WindowLeaked: Activity com.x.x.x has leaked window com.android.int ...

  6. 团队项目建议 - 英语学习 App

    在这几年推广<构建之法>软件工程教学的过程中,我看到很多老师在讲软件工程的时候,虽然讲了很多年,但是手头没有任何项目,学生或者现想(得到一些大而无当,无法在一学期内完成一个可用版本的项目) ...

  7. 《CoffeeScript应用开发》学习: 第四章-改进应用程序

    检查值是否存在 使用存在运算符 CoffeeScript中有一个非常有用的存在运算符?,它能正确地处理值是否存在(存在的意思为变量不为undefined或者null)的情况.在变量后添加?来判断它是否 ...

  8. php限定时间内同一ip只能访问一次

    建立一个数据表 CREATE TABLE `clicks` ( `ip` INT UNSIGNED NOT NULL , `time1` INT UNSIGNED NOT NULL , `time2` ...

  9. 第三周作业--VS 2013 单元测试

    VSTS可以实现自动测试,简而言之就是编写一个测试程序的程序,通过输入自动判断输出是否与预想相符,并给出代码覆盖率等等一大堆统计数据,以下为如何利用这一功能的简介. 1.新建项目,创建一个类.即要完成 ...

  10. ng-style 的坑 - 对性能的影响

    本文地址:http://www.cnblogs.com/jying/p/5633203.html 熟悉 angular 的前端对ng-style 一定不陌生,这个家伙可以绑定一个函数,使得我们可以在函 ...