XML Attributes | Description |
---|---|
android:baselineAligned | When this attribute is set to false, the layout from aligning its children's baselines. |
android:baselineAlignedChildIndex | This attribute specifies which of its children to baseline align. |
Android:divider | This attribute is used as a vertical divider between buttons. |
android:gravity | This attribute specifies how an object should position its content, on both the X and Y axes, within its own bounds. |
android:measureWithLargestChild | This attribute sets to true when all childrens with a weight will be considered having the minimum size of the largest child. |
android:orientation | This attribute defines layout for column and row. Horizontal for a row and Vertical for a column. |
android:weightSum | This attribute defines the maximum weight sum. |
File Name: content_main.xml
<?xml version = "1.0" encoding = "utf-8"?>
<LinearLayout
xmlns:android = "http://schemas.android.com/apk/res/android"
xmlns:tools = "http://schemas.android.com/tools"
xmlns:app = "http://schemas.android.com/apk/res-auto"
android:orientation = "vertical"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:paddingLeft = "@dimen/activity_horizontal_margin"
android:paddingRight = "@dimen/activity_horizontal_margin"
android:paddingTop = "@dimen/activity_vertical_margin"
android:paddingBottom = "@dimen/activity_vertical_margin"
app:layout_behavior = "@string/appbar_scrolling_view_behavior"
tools:showIn = "@layout/activity_main"
tools:context = "com.example.itwin.demo1.MainActivity">
<Button
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:text = "Start"
android:id = "@+id/button"
android:layout_alignParentLeft = "true"
android:layout_alignParentStart = "true"
android:background = "#fff000"
android:textSize = "25dp"
/>
<Button
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:text = "Stop"
android:id = "@+id/button2"
android:layout_below = "@+id/button"
android:layout_alignParentLeft = "true"
android:layout_alignParentStart = "true"
android:background = "#0000ff"
android:textSize = "25dp"
/>
<Button
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:text = "Pause"
android:id = "@+id/button3"
android:layout_below = "@+id/button2"
android:layout_alignParentLeft = "true"
android:layout_alignParentStart = "true"
android:background = "#00f000"
android:textSize = "25dp"
/>
</LinearLayout>