Differences

This shows you the differences between two versions of the page.

Link to this comparison view

dapm:laboratoare:02 [2020/02/28 16:59]
sabina.horincar
dapm:laboratoare:02 [2021/03/23 10:43] (current)
ioana_maria.culic [Lab 02 - Layouts]
Line 1: Line 1:
-====== ​Laboratorul ​02======+====== ​Lab 02 - Layouts ​======
 **LinearLayout**\\ **LinearLayout**\\
 LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. You can specify the layout direction with the __android:​orientation__ attribute.\\ LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally. You can specify the layout direction with the __android:​orientation__ attribute.\\
Line 8: Line 8:
 \\ \\
 \\ \\
 +
 +** Example: **
 +
 +<​code>​
 +<​LinearLayour xmlns:​android="​http://​schemas.android.com/​apk/​res/​android"​
 +   ​android:​layout_width="​fill_parent"​
 +   ​android:​layout_height="​fill_parent"​
 +   ​android:​orientation="​vertical">​
 +   
 +.....
 +</​LinearLayout>​
 +</​code>​
 **Fill_parent**(renamed **MATCH_PARENT** in API Level 8 and higher) vs **Wrap_content** \\ **Fill_parent**(renamed **MATCH_PARENT** in API Level 8 and higher) vs **Wrap_content** \\
 - Setting the layout of a widget to __fill_parent__ will force it to expand to take up as much space as is available within the layout element it's been placed in. It's roughly equivalent of setting the dockstyle of a Windows Form Control to Fill.\\ - Setting the layout of a widget to __fill_parent__ will force it to expand to take up as much space as is available within the layout element it's been placed in. It's roughly equivalent of setting the dockstyle of a Windows Form Control to Fill.\\
Line 61: Line 73:
  
  
-====== Exercises ​======+====== Exercises ======
    
 **Ex 1** A) Make a new app. Transform the layout into a LinearLayout with __orientation vertical__. \\ **Ex 1** A) Make a new app. Transform the layout into a LinearLayout with __orientation vertical__. \\
dapm/laboratoare/02.1582901992.txt.gz ยท Last modified: 2020/02/28 16:59 by sabina.horincar
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0