Constraint layout vs Relative layout

Viewed 4510

I have been mostly designing my views using Relative layout as it works great when you put things positioned from the right edge, center or simply relative to each other. That would great on different screen sizes so the views are more spread.

With the introduction of constraint layout, I find it that it is more powerfull and it achives the same purposes while giving more flexibility.

Does that mean that Relative layout is no longer needed and can be replaced with Constraint all the time? Is there a situation where you shouldn't go constraint view and go for relative layout instead?

Thank you

1 Answers

It is not much different than other layouts you are probably already using (like RelativeLayout or LinearLayout). The attributes are very similar to the ones used with Relative Layout.

This is primarily designed as a visually oriented tool. The visual editor is intended to be the main way developers interact with their layouts.

The main goal of this new layout, is to help developers create complex layouts that are optimized to rendez quickly. In fact, its aim is to reduce layout hierarchies induced by other layout types.

Related