Android Studio: UI Layout


Bismilahhirahmanirrahim ~ In The Name Of Allah The Most Gracious and The Most Merciful

Layout Attributes


ID which is uniquely identify the views


width for layout


height for layout


extra space on the top of side of layout


extra space on the bottom side of layout


extra space on the right side of layout


extra space on the left side of layout


specifies how child Views is positioned


specifies how much of the extra space in the layout should be allocated to the View


specifies the x-coordinate of the layout


specifies the y-coordinate of the layout


left padding filled for the layout


right padding filled for the layout


top padding filled for the layout


bottom padding filled for the layout

Constant to set height and width by using:

  • android:layout_width=wrap_content
  • android:layout_width=wrap_content

What is view? 

I’m not really sure how to explain.. i just like to assign unique variable that called ‘view object’ will find just like this android:id=”@+id/register_button”

  • ‘@’ the beginning of string indicates that the XML parser should parse and expand the rest of ID string and identify it as an ID resourse
  • ‘+’ means that this is a new resource name that must be created and added to our resources. Example how to create an instance of object and capture it from layout.. it just like to declare it.. you can write like this..
  • Button register_button = (Button) findViewById(; 

Layout Type

Linear Layout

LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally.

Relative Layout

RelativeLayout is a view group that displays child views in relative positions.

Table Layout

TableLayout is a view that groups views into rows and columns.

Absolute Layout

AbsoluteLayout enables you to specify the exact location of its children.

Frame Layout

The FrameLayout is a placeholder on screen that you can use to display a single view.

List View

ListView is a view group that displays a list of scrollable items.

Grid View

GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid.

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!
Visit Us On TwitterVisit Us On FacebookVisit Us On PinterestVisit Us On YoutubeVisit Us On Instagram