Some common mistakes when doing layout in Android.

Layouting is an art and we should be artists.

Lam Pham
The Startup

--

Layout xml in Android
Photo by Halacious on Unsplash

We, as Android developers, should be quite familiar with layout xml file. There is no doubt that the skill we master the most in Android development is doing layout xml because we do it everyday, in every feature and for every single UI piece. Back to the old days when ConstraintLayout had not appeared yet, layouting was still very poor and naive. Since ConstraintLayout came out as a new approach to do layout job, layouting has become sexier and more efficient. The benefits of ConstraintLayout are undeniable, however, people still often make some mistakes that undermine all these benefits.

In this article, we will find out some very common mistakes that we encounter regularly in daily coding.

TL;DR

Read the quote in each session.

1. Underestimate ConstraintLayout

ConstraintLayout is a powerful ViewGroup that can draw almost every single screen (from simple to complex usecases). There are very few cases in which ConstraintLayout can not complete the job. When I say ConstraintLayout, I mean the ConstraintLayout library that provides not only the ConstraintLayout but also a set of tools going with it such as: Group, Barrier, Guideline…

--

--