问题描述
要实现什么:ConstraintLayout
或CoordinatorLayout
以便在android中进行正确的材质设计?
What to implement: ConstraintLayout
or CoordinatorLayout
for proper material design in android ?
推荐答案
CoordinatorLayout 是用于管理行为例如互动和动画.
CoordinatorLayout is intended to be the top-level layout for activity to manage the Behaviors e.g. interactions and animations.
ConstraintLayout 的主要目标是提供一种方便的方法来创建具有多个子元素的平面布局(功能更强大的RelativeLayout).
ConstraintLayout's main goal is to provide a convenient way to create a flat layout with multiple children (much more powerful RelativeLayout).
因此,CoordinatorLayout将管理活动组件的复杂行为(尤其是动画),并管理ConstraintLayout来正确放置组件(尤其是列表项).
So the CoordinatorLayout is to manage the complex behavior (especially animations) of your activity's components, and ConstraintLayout for components proper placement (especially list items).
这篇关于ConstraintLayout与Coordinator布局?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!