ConstraintLayout usage restrictions

I can see that Google actively promotes ConstraintLayout. Is this means that it should be used in any case where this is possible? I mean, if we have even some simple view with one or two child views, should we still use ConstraintLayout or this is not justifiable for simple views? I mean from the performance perspective. Are there any restrictions where usage is forbidden?

Upvotes: 0

Views: 68

Answers (2)

Auto-Droid ツ
Auto-Droid ツ

Reputation: 1593

According to @Vardaan performances improvement is seen in the application which is also given in android developer blog and using it eliminates deep nesting, but it’s way too hard to do complex layouts with it since we don't deal with simple layout now days check this

Upvotes: 0

Vardaan Sharma
Vardaan Sharma

Reputation: 1165

Performance suffers when you have multiple nested views eg relative layout contains a linear layout which contains a scroll view etc etc

The nature of constraint layout is that you can achieve things possible only by nesting other views, in a single constraint layout without nesting.

As long as the simple layout does not contain nested views, there is no strong performance gain by using constraint layout.

Upvotes: 1

Related Questions