In new Android Studio 2.2 the Constraint Layout is introduced, I had searched and read about this new layout here and here. and in this link I had read about differences between Constraint and Relative layouts, but still some questions remain:
- Can we replace
RelativeLayout
withConstraintLayout
completly, as mentioned here? - Do devices with old versions can support
ConstraintLayout
? - For designing apps with
ConstraintLayout
we have to update to Android Studio 2.2? - with using
ConstraintLayout
we don’t need to write many dimens.xml for all screen resolution to have a responsive app?
ConstraintLayout
does all thatRelativeLayout
does, and more- It’s supported starting from API level 9 (Gingerbread) — ie. 99.9% of devices
- Yes. You can edit the XML by hand too, but the editor in 2.2 is recommended
- It depends what you want to do — using dimens might still be useful (for example, you might want roughly the same layout, but with different margins).
Answer:
The another fact good to know is that ConstraintLayout provides much better performance than RelativeLayout. Especially nested RelativeLayouts can make your performance worse.
Tags: androidandroid, layout