What is CoordinatorLayout?

后端 未结 7 598
庸人自扰
庸人自扰 2020-12-12 14:43

Just had a look at the demo app of new Android support design library. It\'s provided by Chris Banes on github. Throught the app, CoordinatorLayout is used Heav

7条回答
  •  囚心锁ツ
    2020-12-12 15:33

    The CoordinatorLayout is a super-powered FrameLayout.

    By default, if you add multiple children to a FrameLayout, they would overlap each other. A FrameLayout should be used most often to hold a single child view. The main appeal of the CoordinatorLayout is its ability to coordinate the animations and transitions of the views within it. Using XML only, you can describe a layout where a FAB moves out of the way of an incoming Snackbar, for example, or have a FAB (or any other View really) that is apparently attached to another widget and moves on-screen with the widget.

    Here is the main source tutorial.

提交回复
热议问题