学习Material Design Support

来源:互联网 发布:程序员之路 编辑:程序博客网 时间:2024/05/17 07:38
  • 读Blog,学会使用控件
    http://android-developers.blogspot.com/2015/05/android-design-support-library.html
  • cheesesquare,使用5.0控件项目
    https://github.com/chrisbanes/cheesesquare
  1. DrawerLayout,NavigationView.用于侧边栏实现。
  2. CoordinatorLayout:最外层用于滑动控制app:layout_scrollFlags=“”

    • scroll: this flag should be set for all views that want to scroll off the screen - for views that do not use this flag, they’ll remain pinned to the top of the screen
    • enterAlways: this flag ensures that any downward scroll will cause this view to become visible, enabling the ‘quick return’ pattern
    • enterAlwaysCollapsed: When your view has declared a minHeight and you use this flag, your View will only enter at its minimum height (i.e., ‘collapsed’), only re-expanding to its full height when the scrolling view has reached it’s top.
    • exitUntilCollapsed: this flag causes the view to scroll off until it is ‘collapsed’ (its minHeight) before exiting
  3. AppBarLayout:
    using an AppBarLayoutallows your Toolbar and other views (such as tabs provided by TabLayout) to react to scroll events in a sibling view marked with a ScrollingViewBehavior.

  4. ToolBar:
    using a Toolbar in your layout, allowing you to more easily customize the look and integration of that iconic part of an app with the rest of your layout.

  5. CollapsingToolBarLayout:
    Adding a Toolbar directly to an AppBarLayout gives you access to the enterAlwaysCollapsed andexitUntilCollapsed scroll flags, but not the detailed control on how different elements react to collapsing. For that, you can use CollapsingToolbarLayout:
    处理子元素相应不同的collapsing。
    app:layout_collapseMode=“pin” 或者”parallax”

0 0
原创粉丝点击