Android chaining and Baselining -Android studio tutorial.
Android chains are special constraints that enable making changes on several views at a go. This simply means that we connect various views and we can make alignments on all of the chained views by editing the constraints of one view ie the root view. This helps balance the constraints of views to get consistency rather than having to adjust constraints on all views independently and may not be consistent.
The syntax for chaining:
First, you hover over one view, which will be the root view, and in the options select chains. We then connect the other views by clicking the right or left side of the view and dragging the arrow to the other view you want to connect to. Note that the other vies can only be connected from the root view. After they are connected (chained) we now make the constraints we want on the root view and the other views will also follow suit. This is a great tool to make use of for consistency on android applications.
Base-lining Base-lining is simply giving a similar or equal base to all views. In simple terms, a base is the horizontal position of views. Aligned or positioned according to a single view, a root view, all the other views are positioned in a specific position horizontally. This helps to save time as we only have to align one view and consistency will be achieved for the horizontal positioning.
syntax
We hover on one view, which will be our root view, and in the options, we select baselining or
Thank you for taking the time to read my article. Live laugh code .
Subscribe to my newsletter
Read articles from Maina Martin directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Maina Martin
Maina Martin
Full-stack web developer π©π½βπ»π». Front-end ethusiast I love React, Typescript and Django frameworks π. Interested in all things full-stack android and tech in generalπ