有关CoordinatorLayout的总结
来源:互联网 发布:51单片机简易电子琴 编辑:程序博客网 时间:2024/06/03 11:17
1.BottomSheet <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context="com.example.lianxiday_071302.MainActivity"> <TextView android:layout_width="match_parent" android:layout_height="match_parent" android:text="Hello World!" /> <RelativeLayout app:behavior_hideable="false" app:behavior_peekHeight="200dp" android:background="@color/colorAccent" app:layout_behavior="@string/bottom_sheet_behavior" android:layout_width="match_parent" android:layout_height="match_parent"> <ListView android:id="@+id/lv" android:layout_width="match_parent" android:layout_height="match_parent" /> </RelativeLayout></android.support.design.widget.CoordinatorLayout>![效果图](http://img.blog.csdn.net/20170713142638168?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQveGlhb3NoaXRvdW5hbg==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast)2.Toolbar的收缩与扩展注意:如果是listview或gridview需要在listview中加上属性:android:nestedScrollingEnabled="true"布局:<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:app="http://schemas.android.com/apk/res-auto" tools:context="com.example.lianxiday_071302.MainActivity"> <android.support.design.widget.AppBarLayout android:id="@+id/appbar" android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"> <android.support.v7.widget.Toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionBarSize" android:background="?attr/colorPrimary" app:layout_scrollFlags="scroll|enterAlways" app:popupTheme="@style/ThemeOverlay.AppCompat.Light"/> </android.support.design.widget.AppBarLayout> <ListView app:layout_behavior="@string/appbar_scrolling_view_behavior" android:id="@+id/lv" android:nestedScrollingEnabled="true" android:layout_width="match_parent" android:layout_height="match_parent" /></android.support.design.widget.CoordinatorLayout>3.viewpager实现把上面图片推上去的效果
阅读全文
0 0
- 有关CoordinatorLayout的总结
- 有关于CoordinatorLayout介绍
- CoordinatorLayout与Behavior 的使用总结
- CoordinatorLayout自定义Behavior的简单总结
- CoordinatorLayout与Behavior总结
- CoordinatorLayout使用总结
- 有关jdbc的总结
- 有关输入的总结
- 有关spl的总结
- 有关动画的总结
- 有关maven的总结
- 有关路径的总结
- 有关数据类型转换的总结
- 有关论文的个人总结
- 有关c的一些总结
- 有关数据类型转换的总结
- 有关BBS项目的总结
- 有关音视频的总结
- safari中遇到的坑
- 正则匹配:match与exec
- 2017-03-21 Flex布局新旧混合写法详解(兼容微信) http://www.tuicool.com/articles/Yzeu6j7
- controller单元测试
- Struts2框架学习(二) Action
- 有关CoordinatorLayout的总结
- js弹出层评论前判断是否要登录
- pod install 慢
- Spring 使用注解方式进行事务管理
- Shell的使用
- ios集成Charts框架并绘制柱形图详解
- Python处理缺失值
- js中cookie的使用
- Struts2框架学习(三) 数据处理