zoukankan      html  css  js  c++  java
  • 协调者布局:CoordinatorLayout

    layout_scrollFlag属性:
    scroll:需要哪个View滚动就需要设置该属性;
    exitUntilCollapsed:向上推动屏幕的时候滑动的部分折叠起来,只有下滑到最低端的时候折叠部分才会出现

    enterAlways:只要下滑的时候,折叠的部分就会出现

    enterAlwaysCollapsed:以最小高度折叠起来,到达顶部显示完整高度
    <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:orientation="vertical">
    
        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="295dp">
                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="200dp"
                    android:scaleType="fitXY"
             app:layout_scrollFlags="scroll|exitUntilCollapsed"

    android:src="@mipmap/weimeithree" />
            <android.support.design.widget.TabLayout
                android:id="@+id/tab_layout"
                android:layout_width="match_parent"
                style="@style/TabLayoutText"
                app:tabSelectedTextColor="#08f213"
                android:layout_height="35dp"
                android:layout_marginTop="5dp" />
        </android.support.design.widget.AppBarLayout>
    
        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager_my_fragment"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    
    </android.support.design.widget.CoordinatorLayout>

    底部内容必须是ViewPager或者NestedScrollView。ViewPager里面的布局也必须是NestdScrollView.

  • 相关阅读:
    重新认识数据库的链接查询
    mysql删除一张表中的重复数据
    mysql数据库里复制一张表的SQL,报错 (1786
    case when的使用场景。
    python:浅析python 中__name__ = '__main__' 的作用
    Group(), Groups(),& Groupdict() 用法
    python re模块findall()详解
    练习题(第二模块...模块...选择填空)
    subprocess模块 sys模块
    json,pickle,shelve模块,xml处理模块
  • 原文地址:https://www.cnblogs.com/shen-hua/p/5895555.html
Copyright © 2011-2022 走看看