You are on page 1of 7

Layouts in Android UI Design

Read Courses Jobs

Layout Managers (or simply layouts) are said to be extensions of the ViewGroup
class. They are used to set the position of child Views within the UI we are
building. We can nest the layouts, and therefore we can create arbitrarily complex
UIs using a combination of layouts.

There is a number of layout classes in the Android SDK. They can be used,
modified or can create your own to make the UI for your Views, Fragments and
Activities. You can display your contents effectively by using the right
combination of layouts.

The most commonly used layout classes that are found in Android SDK are:

FrameLayout- It is the simplest of the Layout Managers that pins each child
view within its frame. By default the position is the top-left corner, though the
gravity attribute can be used to alter its locations. You can add multiple
children stacks each new child on top of the one before, with each new View
potentially obscuring the previous ones.
LinearLayout- A LinearLayout aligns each of the child View in either a vertical
or a horizontal line. A vertical layout has a column of Views, whereas in a
horizontal layout there is a row of Views. It supports a weight attribute for
each child View that can control the relative size of each child View within the
available space.

Courses @90% Refund Trending Now Data Structures & Algorithms Foundational Courses Data Science Practice

RelativeLayout- It is flexible than other native layouts as it lets us to define


the position of each child View relative to the other views and the dimensions
of the screen.
GridLayout- It was introduced in Android 4.0 (API level 14), the Grid Layout
used a rectangular grid of infinitely thin lines to lay out Views in a series of
rows and columns. The Grid Layout is incredibly flexible and can be used to
greatly simplify layouts and reduce or eliminate the complex nesting often
required to construct UIs using the layouts described before.

Each of these layouts is designed to scale to suit the screen size of the host
device by avoiding the used of absolute co- ordinates of the positions or
predetermined pixel values. This makes the app suitable for the diverse set of
Android devices.

Ready to embark on an exciting journey into the world of Android Development


with Kotlin? It's time to make a change and dive into a fantastic learning
experience with our Mastering Android Development with Kotlin From Beginner
to Pro - Self Paced!

Three 90 Challenge ending on 5th Feb! Last chance to get 90% refund by completing
90% course in 90 days. Explore offer now.

Last Updated : 19 Sep, 2023 27

Previous Next

Memory Leaks in Android Android UI Layouts

Share your thoughts in the comments Add Your Comment

Similar Reads
Android UI Layouts Material Design Buttons in Android with
Example

Theming Material Design Buttons in Material Design Date Picker in Android


Android with Examples

More Functionalities of Material Design Material Design EditText in Android with


Date Picker in Android Example
Introduction to Material Design in Android Theming of Material Design EditText in
Android with Example

Key Properties of Material Design EditText Snackbar Material Design Components in


in Android Android

D dewangN…

Article Tags : android , Misc


Practice Tags : Misc

Additional Information

A-143, 9th Floor, Sovereign Corporate


Tower, Sector-136, Noida, Uttar Pradesh -
201305

Company Explore
About Us Job-A-Thon Hiring Challenge
Legal Hack-A-Thon
Careers GfG Weekly Contest
In Media Offline Classes (Delhi/NCR)
Contact Us DSA in JAVA/C++
Advertise with us Master System Design
GFG Corporate Solution Master CP
Placement Training Program GeeksforGeeks Videos
Apply for Mentor Geeks Community

Languages DSA
Python Data Structures
Java Algorithms
C++ DSA for Beginners
PHP Basic DSA Problems
GoLang DSA Roadmap
SQL Top 100 DSA Interview Problems
R Language DSA Roadmap by Sandeep Jain
Android Tutorial All Cheat Sheets
Tutorials Archive

Data Science & ML HTML & CSS


Data Science With Python HTML
Data Science For Beginner CSS
Machine Learning Tutorial Web Templates
ML Maths CSS Frameworks
Data Visualisation Tutorial Bootstrap
Pandas Tutorial Tailwind CSS
NumPy Tutorial SASS
NLP Tutorial LESS
Deep Learning Tutorial Web Design

Python Computer Science


Python Programming Examples GATE CS Notes
Django Tutorial Operating Systems
Python Projects Computer Network
Python Tkinter Database Management System
Web Scraping Software Engineering
OpenCV Python Tutorial Digital Logic Design
Python Interview Question Engineering Maths

DevOps Competitive Programming


Git Top DS or Algo for CP
AWS Top 50 Tree
Docker Top 50 Graph
Kubernetes Top 50 Array
Azure Top 50 String
GCP Top 50 DP
DevOps Roadmap Top 15 Websites for CP

System Design JavaScript


High Level Design JavaScript Examples
Low Level Design TypeScript
UML Diagrams ReactJS
Interview Guide NextJS
Design Patterns AngularJS
OOAD NodeJS
System Design Bootcamp Lodash
Interview Questions Web Browser

NCERT Solutions School Subjects


Class 12 Mathematics
Class 11 Physics
Class 10 Chemistry
Class 9 Biology
Class 8 Social Science
Complete Study Material English Grammar

Commerce UPSC Study Material


Accountancy Polity Notes
Business Studies Geography Notes
Economics History Notes
Management Science and Technology Notes
HR Management Economy Notes
Finance Ethics Notes
Income Tax Previous Year Papers

SSC/ BANKING Colleges


SSC CGL Syllabus Indian Colleges Admission & Campus Experiences
SBI PO Syllabus List of Central Universities - In India
SBI Clerk Syllabus Colleges in Delhi University
IBPS PO Syllabus IIT Colleges
IBPS Clerk Syllabus NIT Colleges
SSC CGL Practice Papers IIIT Colleges

Companies Preparation Corner


META Owned Companies Company Wise Preparation
Alphabhet Owned Companies Preparation for SDE
TATA Group Owned Companies Experienced Interviews
Reliance Owned Companies Internship Interviews
Fintech Companies Competitive Programming
EdTech Companies Aptitude Preparation
Puzzles

Exams More Tutorials


JEE Mains Software Development
JEE Advanced Software Testing
GATE CS Product Management
NEET SAP
UGC NET SEO - Search Engine Optimization
Linux
Excel

Free Online Tools Write & Earn


Typing Test Write an Article
Image Editor Improve an Article
Code Formatters Pick Topics to Write
Code Converters Share your Experiences
Currency Converter Internships
Random Number Generator
Random Password Generator

@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved

You might also like