ViewGroup or Layout
There are six types of Layouts:
1.LinearLayout (the box model)
2.RelativeLayout (a rule-based model)
3.TableLayout (the grid model)
4.Frame Layout (it provides space in layout)
5. Absolute Layout (Non flexible model) – Deprecated Now
6. Grid Layout (the grid model) – Introduced in ice cream sandwich
android:id
• This provides a unique identifier for the view, which you can use to reference the object from your app code, such as to read and manipulate the object • For the ID value, use this syntax form: "@+id/name". The at sign (@) is required whenever reference is being made to any resource object from XML. It is followed by the resource type (id in this case), a slash, then the resource name • The plus symbol, +, indicates that this is a new resource ID and the aapt tool will create a new resource integer in the R.java class, if it doesn't already exist • However, if an ID resource is defined, then you can apply that ID to a View element by excluding the + symbol in the android:id value • This id field is used to reference screen variable in program by using findViewById.
Layout Parameters
Fill Model : All widgets inside a LinearLayout must supply dimensional attributes android:layout_width and android:layout_height to help address the issue of empty space. Values used in defining height and width are:
1.Specific a particular dimension, such as 125dip (device independent pixels)
2. wrap_content: which means the widget should fill up its natural space, unless that is too big, in which case Android can use word-wrap as needed to make it fit.
3. fill_parent: which means the widget should fill up all available space in its enclosing container, after all other widgets are taken care of
1.LinearLayout (the box model)
2.RelativeLayout (a rule-based model)
3.TableLayout (the grid model)
4.Frame Layout (it provides space in layout)
5. Absolute Layout (Non flexible model) – Deprecated Now
6. Grid Layout (the grid model) – Introduced in ice cream sandwich
android:id
• This provides a unique identifier for the view, which you can use to reference the object from your app code, such as to read and manipulate the object • For the ID value, use this syntax form: "@+id/name". The at sign (@) is required whenever reference is being made to any resource object from XML. It is followed by the resource type (id in this case), a slash, then the resource name • The plus symbol, +, indicates that this is a new resource ID and the aapt tool will create a new resource integer in the R.java class, if it doesn't already exist • However, if an ID resource is defined, then you can apply that ID to a View element by excluding the + symbol in the android:id value • This id field is used to reference screen variable in program by using findViewById.
Layout Parameters
Fill Model : All widgets inside a LinearLayout must supply dimensional attributes android:layout_width and android:layout_height to help address the issue of empty space. Values used in defining height and width are:
1.Specific a particular dimension, such as 125dip (device independent pixels)
2. wrap_content: which means the widget should fill up its natural space, unless that is too big, in which case Android can use word-wrap as needed to make it fit.
3. fill_parent: which means the widget should fill up all available space in its enclosing container, after all other widgets are taken care of
Post a Comment