CoordinatorLayout+TabLayout+ViewPager
<?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的更多相关文章
- TabLayout + ViewPager
一.实现思路 1.在build.gradle中添加依赖,例如: compile 'com.android.support:support-v4:23.4.0'compile 'com.android. ...
- 使用FragmentTabHost+TabLayout+ViewPager实现双层嵌套Tab
大多数应用程序都会在底部使用3~5个Tab对应用程序的主要功能进行划分,对于一些信息量非常大的应用程序,还需要在每个Tab下继续划分子Tab对信息进行分类显示. 本文实现采用FragmentTabHo ...
- 浅谈TabLayout(ViewPager+Tab联动)
google发布了的Android Support Design库中提供了TabLayout 通过TabLayout+ViewPager实现导航栏效果,点击Tab ,ViewPager跟随变化,滑动V ...
- 介绍三个Android支持库控件:TabLayout+ViewPager+RecyclerView
本文主要介绍如下三个Android支持库控件的配合使用: TabLayout:android.support.design.widget.TabLayout ViewPager:android.sup ...
- [置顶]
xamarin Tablayout+Viewpager+Fragment顶部导航栏
最近几天不忙,所以把项目中的顶部导航栏的实现归集一下.android中使用TabLayout+ViewPager+Fragment制作顶部导航非常常见,代码实现也比较简单.当然我这个导航栏是基于xam ...
- Android开发之漫漫长途 Fragment番外篇——TabLayout+ViewPager+Fragment
该文章是一个系列文章,是本人在Android开发的漫漫长途上的一点感想和记录,我会尽量按照先易后难的顺序进行编写该系列.该系列引用了<Android开发艺术探索>以及<深入理解And ...
- ViewPagerWithRecyclerDemo【RecyclerView+ViewPager实现类似TabLayout+ViewPager效果】
版权声明:本文为HaiyuKing原创文章,转载请注明出处! 前言 使用RecyclerView+ViewPager实现类似TabLayout+ViewPager效果. 效果图 使用步骤 一.项目组织 ...
- 安卓TabLayout+ViewPager实现切页
安卓使用TabLayout+ViewPager+Fragment 实现页面切换,可实现左右滑动切换视图界面和点击切换 可自定义菜单栏是在顶部还是在底部 一.实现效果: 二.实现过程: 2.1 一些重要 ...
- TabLayout+ViewPager 标题不显示问题
第一次用TabLayout+ViewPager 组合在布局中写好了三个标题预览没问题而且也设置了 app:tabIndicatorColor="@color/colorAccent" ...
随机推荐
- SQLServer2008-镜像数据库实施手册(双机)SQL-Server2014同样适用
SQL Server2008R2-镜像数据库实施手册(双机)SQL Server2014同样适用 一.配置主备机 1. 服务器基本信息 主机名称为:HOST_A,IP地址为:192.168.1.155 ...
- mysql load data 乱码的问题
新学mysql在用load data导入txt文档时发现导入的内容,select 之后是乱码,先后把表,数据库的字符集类型修改为utf8,但还是一样,最后在 http://bbs.chinaunix. ...
- 诺基亚N900使用技巧
一直都对 Linux 的掌上终端挺感冒的,最近从闲鱼上入后一台欧版的,开机进行评测和使用.以下经验仅供新手参考. 选择 N900 是有原因的,首先 N900 相对来说比较小巧(作为 MID,对比起手机 ...
- Qt 环境下的mapx控件-------2
今天花了一天的时间去查找mapx相关的资料,但是到最后想要的东西还是一无所获,不过还是学到了很多东西.下面以大家分享一下: mapx软件的安装:下载后安装mapx软件,成功后会在安装路径下存在acti ...
- (Hibernate进阶)Hibernate系列——总结篇(九)
这篇博文是hibernate系列的最后一篇,既然是最后一篇,我们就应该进行一下从头到尾,整体上的总结,将这个系列的内容融会贯通. 概念 Hibernate是一个对象关系映射框架,当然从分层的角度看,我 ...
- 关于Jquery中ajax介绍
jQuery 底层 AJAX 实现.简单易用的高层实现见 $.get, $.post 等.$.ajax() 返回其创建的 XMLHttpRequest 对象.大多数情况下你无需直接操作该函数,除非你需 ...
- 基础篇-spring包的下载
首先去到String官网 往下拉一点会看到如下图所示点击进入下一步 进入以后找到如下图所示的 然后按照下图所示操作 选择你想要的版本点击它 选择spring的完整包下载如图
- Cocos2d-x-3.0 Touch事件处理机制
在学习Cocos2d-html5游戏例子的时候,注册事件代码一直提示:TypeError: cc.Director._getInstance(...).getTouchDispatcher is no ...
- 深入理解CSS溢出overflow & overflow:hidden真的失效了吗[转载]
深入理解CSS溢出overflow http://www.cnblogs.com/xiaohuochai/p/5289653.html overflow:hidden真的失效了吗 http://www ...
- 第六百一十一天 how can I 坚持
离开泛华了,在那感觉确实挺压抑的,什么环境才适合我呢.哎. 明天回济南,弟弟交房了,去看看房子,和郭娜跨个年,好好谈吧,尽快结婚了. 睡觉.