SlideShare a Scribd company logo
1 of 15
Rajab Davudov
What is a Layout ?
• A type of resource that defines what is
  drawn on the screen.
• A type of View class whose primary
  purpose is to organize other controls.
Why a Layout ?
• More than 300 devices
with different
  – Screen sizes and dimensions
  – Screen densities
  – Android versions
  – OEM skins
  – Control interfaces
Android Layouts
•   LinearLayout
•   RelativeLayout
•   TableLayout
•   FrameLayout
•   AbsoluteLayout
•   …
Linear Layout
In a linear layout, like the name suggests, all the elements are
displayed in a linear fashion(below is an example of the linear
layouts), either Horizontally or Vertically and this behavior is set
in android:orientation which is an attribute of the node
LinearLayout.

<LinearLayout android:orientation="vertical"> .... </LinearLayout>
OR
<LinearLayout android:orientation=“horizontal"> .... </LinearLayout>
Linear Layout
Relative Layout
In a relative layout every element arranges itself relative to other
elements or a parent element.

As an example, lets consider the layout defined below. The
“Cancel” button is placed relatively, to the right of the “Login”
button parallel. Here is the code snippet that achieves the
mentioned alignment (Right of Login button parallel)
Relative Layout
Table Layout
Table layouts in Android works in the same way HTML table
layouts work. You can divide your layouts into rows and columns.
Its very easy to understand. The image below should give you an
idea
Table Layout
Absolute Layout
Non-professional and not recommended layout !!!
Custom Layout Resource
• res/
   – layout/
   – layout-land/
   – layout-xlarge-v11/
   – layout-xlarge-land-v11/
Density Independent Pixels
• dp or dip
Think, Design, Code !!!
Rajab Davudov
  Senior Developer at Azerfon
            radjab@gmail.com
https://market.android.com/developer?pub=RADJAB
http://gplus.to/radjab
http://www.fb.me/rajab.davudov
http://www.linkedin.com/in/radjab


                           Market
                          QR Code

More Related Content

Viewers also liked

NatureScapes C Cofthe South Planting
NatureScapes C Cofthe South PlantingNatureScapes C Cofthe South Planting
NatureScapes C Cofthe South Plantingmdangler
 
NatureScapes planting at Country Club of the South
NatureScapes planting at Country Club of the SouthNatureScapes planting at Country Club of the South
NatureScapes planting at Country Club of the Southmdangler
 
Access Experiences Spring 09
Access Experiences Spring 09Access Experiences Spring 09
Access Experiences Spring 09RGierschick
 
Riccardo Russo Marketing Consultant - Tv, Media and Entertainment
Riccardo Russo Marketing Consultant - Tv, Media and EntertainmentRiccardo Russo Marketing Consultant - Tv, Media and Entertainment
Riccardo Russo Marketing Consultant - Tv, Media and EntertainmentRiccardo Russo
 

Viewers also liked (6)

NatureScapes C Cofthe South Planting
NatureScapes C Cofthe South PlantingNatureScapes C Cofthe South Planting
NatureScapes C Cofthe South Planting
 
 
NatureScapes planting at Country Club of the South
NatureScapes planting at Country Club of the SouthNatureScapes planting at Country Club of the South
NatureScapes planting at Country Club of the South
 
Access Experiences Spring 09
Access Experiences Spring 09Access Experiences Spring 09
Access Experiences Spring 09
 
Historia
HistoriaHistoria
Historia
 
Riccardo Russo Marketing Consultant - Tv, Media and Entertainment
Riccardo Russo Marketing Consultant - Tv, Media and EntertainmentRiccardo Russo Marketing Consultant - Tv, Media and Entertainment
Riccardo Russo Marketing Consultant - Tv, Media and Entertainment
 

Similar to Android Layout Types Explained in Detail

MOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENTMOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENTMuhammad Sajid
 
W1_Lec01_Lec02_Layouts.pptx
W1_Lec01_Lec02_Layouts.pptxW1_Lec01_Lec02_Layouts.pptx
W1_Lec01_Lec02_Layouts.pptxssuserc1e786
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
WMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxWMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxfahmi324663
 
Android Design Support Library
Android Design Support LibraryAndroid Design Support Library
Android Design Support LibraryIbnu Sina Wardy
 
WMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptxWMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptxfahmi324663
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/TipsKen Yee
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layoutKrazy Koder
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando Gallego
 
Spectrum 2015 responsive design
Spectrum 2015   responsive designSpectrum 2015   responsive design
Spectrum 2015 responsive designNeil Perlin
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hatNeil Perlin
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-TejamFandat
 
Session #7 rich and responsive layouts
Session #7  rich and responsive layoutsSession #7  rich and responsive layouts
Session #7 rich and responsive layoutsVitali Pekelis
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?Brenda Cook
 
Rethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern ageRethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern ageshwetank
 
Android training day 2
Android training day 2Android training day 2
Android training day 2Vivek Bhusal
 

Similar to Android Layout Types Explained in Detail (20)

MOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENTMOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENT
 
W1_Lec01_Lec02_Layouts.pptx
W1_Lec01_Lec02_Layouts.pptxW1_Lec01_Lec02_Layouts.pptx
W1_Lec01_Lec02_Layouts.pptx
 
android layouts
android layoutsandroid layouts
android layouts
 
WMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxWMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptx
 
Android Design Support Library
Android Design Support LibraryAndroid Design Support Library
Android Design Support Library
 
WMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptxWMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptx
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/Tips
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
 
Spectrum 2015 responsive design
Spectrum 2015   responsive designSpectrum 2015   responsive design
Spectrum 2015 responsive design
 
Android ppt.pptx
Android ppt.pptxAndroid ppt.pptx
Android ppt.pptx
 
Chapter 5 - Layouts
Chapter 5 - LayoutsChapter 5 - Layouts
Chapter 5 - Layouts
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hat
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Session #7 rich and responsive layouts
Session #7  rich and responsive layoutsSession #7  rich and responsive layouts
Session #7 rich and responsive layouts
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Rethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern ageRethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern age
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
Android training day 2
Android training day 2Android training day 2
Android training day 2
 
Designing with Code
Designing with CodeDesigning with Code
Designing with Code
 

Recently uploaded

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxPoojaSen20
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Seán Kennedy
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxAshokKarra1
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)cama23
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management SystemChristalin Nelson
 

Recently uploaded (20)

4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptxCulture Uniformity or Diversity IN SOCIOLOGY.pptx
Culture Uniformity or Diversity IN SOCIOLOGY.pptx
 
Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...Student Profile Sample - We help schools to connect the data they have, with ...
Student Profile Sample - We help schools to connect the data they have, with ...
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
Karra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptxKarra SKD Conference Presentation Revised.pptx
Karra SKD Conference Presentation Revised.pptx
 
Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)Global Lehigh Strategic Initiatives (without descriptions)
Global Lehigh Strategic Initiatives (without descriptions)
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Transaction Management in Database Management System
Transaction Management in Database Management SystemTransaction Management in Database Management System
Transaction Management in Database Management System
 

Android Layout Types Explained in Detail

  • 2. What is a Layout ? • A type of resource that defines what is drawn on the screen. • A type of View class whose primary purpose is to organize other controls.
  • 3. Why a Layout ? • More than 300 devices with different – Screen sizes and dimensions – Screen densities – Android versions – OEM skins – Control interfaces
  • 4. Android Layouts • LinearLayout • RelativeLayout • TableLayout • FrameLayout • AbsoluteLayout • …
  • 5. Linear Layout In a linear layout, like the name suggests, all the elements are displayed in a linear fashion(below is an example of the linear layouts), either Horizontally or Vertically and this behavior is set in android:orientation which is an attribute of the node LinearLayout. <LinearLayout android:orientation="vertical"> .... </LinearLayout> OR <LinearLayout android:orientation=“horizontal"> .... </LinearLayout>
  • 7. Relative Layout In a relative layout every element arranges itself relative to other elements or a parent element. As an example, lets consider the layout defined below. The “Cancel” button is placed relatively, to the right of the “Login” button parallel. Here is the code snippet that achieves the mentioned alignment (Right of Login button parallel)
  • 9. Table Layout Table layouts in Android works in the same way HTML table layouts work. You can divide your layouts into rows and columns. Its very easy to understand. The image below should give you an idea
  • 11. Absolute Layout Non-professional and not recommended layout !!!
  • 12. Custom Layout Resource • res/ – layout/ – layout-land/ – layout-xlarge-v11/ – layout-xlarge-land-v11/
  • 15. Rajab Davudov Senior Developer at Azerfon radjab@gmail.com https://market.android.com/developer?pub=RADJAB http://gplus.to/radjab http://www.fb.me/rajab.davudov http://www.linkedin.com/in/radjab Market QR Code