1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Drain Droids

Android Studio For Beginners.Mobile Apps.Android Games.

Sunday, December 30, 2018

Understanding Different Layout in Android Applications



Layout is how your design arrangement looks on screen. In android application, you have to understand the type of layout you want to use. It’s very important to understand your layout because it help you have an idea how your graphic works will be displayed on screen. Sometimes, you can use more than one layout in your designs.

Below is just a brief explanations of different type of layout you will be working with in android application.

1-Constraint Layout
Constraint Layout let you create large and complex layout with a flat view hierarchy. Also let you, it flexible which can allow you position and size as you want and works better with layout editor. So you can build your layout with ConstraintLayout entirely by drag-and-dropping instead of editing the XML.



2-LinearLayout
The basic behaviour of LinearLayout is to flow its children in either a horizontal or vertical direction, depending on the orientation. Achieving that is really simple in the editor. To create the same behaviour as a vertical LinearLayout is simply a case of adding additional views, and then constraining the top of each view to the bottom of the view immediately above it:


3-RelativeLayout
A RelativeLayout is used to layout views based on some forms of relations each have relative to the other. If this sounds familiar, it is because a RelativeLayout is basically a more basic version of a ConstraintLayout, and many of the concepts of the latter map directly to RelativeLayout. In fact, one can think of a ConstraintLayout as a RelativeLayout on steroids; this is a good mental model to use to get acquainted to ConstraintLayout if you have experience using the “old-school” Android layouts.


4-Table Layout
In Android, Table Layout is used to arrange the group of views into rows and columns. Table Layout containers do not display a border line for their columns, rows or cells. A Table will have as many columns as the row with the most cells.


5-Frame Layout
Frame Layout is one of the simplest layout to organize view controls. They are designed to block an area on the screen. Frame Layout should be used to hold child view, because it can be difficult to display single views at a specific area on the screen without overlapping each other.