Building layouts using grids
When building screens, it's common to want specific widgets to appear the same size and shape as other widgets. This is often achieved using flexible grid models for the layout. By dividing the screen into a number of cells, and having each widget occupy one or more cells, you can create very complex layouts that will stretch to any screen size. However, this traditional model is completely outdated when faced with ConstraintLayout
, which is capable of maintaining complex relationships between widgets without the need for a grid.
In most situations, ConstraintLayout
should be more than capable of managing any complex layout you choose to design, and will be much more flexible than a grid/table layout manager. Unlike a grid-based layout engine, ConstraintLayout
is much more flexible when dealing with widgets that are sized based on a font or images that can be various sizes, depending on the physical screen size and pixel-density. While GridLayout
will adjust...