Create an application for demonstration of Relative and Table Layout in android.
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Relative Layout"
android:id="@+id/textview1"/>
<TableLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:stretchColumns="0,1"
android:layout_below="@+id/textview1">
<TableRow>
<Button
android:text="Button 1"
android:layout_margin="10dp"
/>
<Button
android:text="Button2"
android:layout_margin="10dp"
/>
</TableRow>
</TableLayout>
</RelativeLayout>
Output
0 Comments
Post a Comment