Android: Difference Between Relative And Constraint Layout

Posted By : Akash Tomer | 31-May-2018

In the event that you began Android advancement just as of late, you won't think about RelativeLayout, in light of the fact that BasicActivity layout runs with ConstraintLayout, yet before there was a RelativeLayout. How about we analyze those two

Relative Layout:

RelativeLayout is an approach to actualize complex formats with level (one level of settling) outline. By its outline, it's overlaying things, not at all like LinearLayout that never does that Its name says independent from anyone else, RelativeLayout is awesome at situating things in respect to other. Suppose you have undetermined view width and you need to put a thing to one side of it and to the base of it in the meantime. You can do that with LinearLayout, however, it would take two settled, with RelativeLayout it got way cleaner.

Constraint Layout:

The center is RelativeLayout where things can overlay. Be that as it may, what makes ConstraintLayout awesome is it can supplant the various designs: Frame, Relative, Linear. Truly, there are numerous different formats, yet those are wrappers What I like about ConstraintLayout is that it's extremely awesome at utilizing as a part of Design mode before I didn't care for it by any means. For the most part in view of the poor execution of my fair equipment (for Android Studio) and regular rendering bugs ConstraintLayout properties really are so long and appalling that it's better utilizing it Design mode. It can control position and measurements (not at all like RelativeLayout) of perspectives. Keep in mind, that parameters beginning with layout_ are implied for wrapping format. The view itself doesn't deal with those 

So you can utilize your most loved weight from LinearLayout in ConstraintLayout by imperative chains, land left/right/top/base of from RelativeLayout, overlay things like in straightforward FrameLayout I think no one uses GridLayout, it's far excessively disappointing, constantly favored settled LinearLayout, with ConstraintLayout you can do that effortlessly

Constraint Layout Disadvantage:

Despite the fact that it's awesome, outline mode still isn't as immaculate as XML. It gets jumbled simple, you have to zoom in on perspectives and it drives you to have simply ConstraintLayout, in the event that you endeavor to include some settled design – you'd think twice about it.

Hope this will help you.

 

About Author

Author Image
Akash Tomer

Akash is an Android Developer at Oodles Technology.

Request for Proposal

Name is required

Comment is required

Sending message..