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  pur...
Why is a Layout ?• More than 300 deviceswith different  – Screen sizes and dimensions  – Screen densities  – Android versi...
Android Layouts•   LinearLayout•   RelativeLayout•   TableLayout•   FrameLayout•   AbsoluteLayout•   …
Linear LayoutIn a linear layout, like the name suggests, all the elements aredisplayed in a linear fashion(below is an exa...
Linear Layout
Relative LayoutIn a relative layout every element arranges itself relative to otherelements or a parent element.As an exam...
Relative Layout
Table LayoutTable layouts in Android works in the same way HTML tablelayouts work. You can divide your layouts into rows a...
Table Layout
Absolute LayoutNon-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
Ready, Steady, Code !!!
Rajab Davudov  Senior Developer at Azerfon            radjab@gmail.comhttps://market.android.com/developer?pub=RADJABhttp:...
Upcoming SlideShare
Loading in …5
×

Rajab Davudov - Android UI Design: Layouts

2,439 views

Published on

Rajab Davudov - Android UI Design: Layouts

  • Be the first to comment

  • Be the first to like this

Rajab Davudov - Android UI Design: Layouts

  1. 1. Rajab Davudov
  2. 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. 3. Why is a Layout ?• More than 300 deviceswith different – Screen sizes and dimensions – Screen densities – Android versions – OEM skins – Control interfaces
  4. 4. Android Layouts• LinearLayout• RelativeLayout• TableLayout• FrameLayout• AbsoluteLayout• …
  5. 5. Linear LayoutIn a linear layout, like the name suggests, all the elements aredisplayed in a linear fashion(below is an example of the linearlayouts), either Horizontally or Vertically and this behavior is setin android:orientation which is an attribute of the nodeLinearLayout.<LinearLayout android:orientation="vertical"> .... </LinearLayout>OR<LinearLayout android:orientation=“horizontal"> .... </LinearLayout>
  6. 6. Linear Layout
  7. 7. Relative LayoutIn a relative layout every element arranges itself relative to otherelements 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 thementioned alignment (Right of Login button parallel)
  8. 8. Relative Layout
  9. 9. Table LayoutTable layouts in Android works in the same way HTML tablelayouts work. You can divide your layouts into rows and columns.Its very easy to understand. The image below should give you anidea
  10. 10. Table Layout
  11. 11. Absolute LayoutNon-professional and not recommended layout !!!
  12. 12. Custom Layout Resource• res/ – layout/ – layout-land/ – layout-xlarge-v11/ – layout-xlarge-land-v11/
  13. 13. Density Independent Pixels• dp or dip
  14. 14. Ready, Steady, Code !!!
  15. 15. Rajab Davudov Senior Developer at Azerfon radjab@gmail.comhttps://market.android.com/developer?pub=RADJABhttp://gplus.to/radjabhttp://www.fb.me/rajab.davudovhttp://www.linkedin.com/in/radjab Market QR Code

×