0% found this document useful (0 votes)
8 views

Practical no 6

The document contains XML layout code for two Android UI components: a TableLayout and a FrameLayout. The TableLayout displays a list of student roll numbers and names, while the FrameLayout overlays multiple TextViews displaying various data types. Both layouts are designed to fill the parent container and include specific styling attributes.

Uploaded by

spidermakdi5324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Practical no 6

The document contains XML layout code for two Android UI components: a TableLayout and a FrameLayout. The TableLayout displays a list of student roll numbers and names, while the FrameLayout overlays multiple TextViews displaying various data types. Both layouts are designed to fill the parent container and include specific styling attributes.

Uploaded by

spidermakdi5324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Practical no 6.

1 Table Layout

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>

<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

android:layout_gravity="center"

android:padding="150dp"

tools:context=".MainActivity">

<TableRow>

<TextView

android:layout_width="50dp"

android:layout_height="20dp"

android:text="Roll no"/>

<TextView

android:layout_width="40dp"

android:height="20dp"

android:text="Name"/>

</TableRow>

<TableRow>

<TextView

android:layout_width="50dp"

android:layout_height="20dp"

android:text="1111"/>

<TextView

android:layout_width="40dp"

android:height="20dp"

android:text="ram"/>

</TableRow>

<TableRow>
<TextView

android:layout_width="50dp"

android:layout_height="20dp"

android:text="2222"/>

<TextView

android:layout_width="40dp"

android:height="20dp"

android:text="Sham"/>

</TableRow>

<TableRow

android:layout_width="wrap_content"

android:layout_height="51dp">

<TextView

android:layout_width="50dp"

android:layout_height="20dp"

android:text="3333" />

<TextView

android:layout_width="40dp"

android:height="20dp"

android:text="sita" />

</TableRow>

</TableLayout>

Output:
Practical 6.2 Frame Layout

Activity_main.xml

<?xml version="1.0" encoding="utf-8"?>

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"

xmlns:app="http://schemas.android.com/apk/res-auto"

xmlns:tools="http://schemas.android.com/tools"

android:layout_width="match_parent"

android:layout_height="match_parent"

tools:context=".MainActivity">

<ImageView

android:layout_width="match_parent"

android:layout_height="match_parent"

android:src="@drawable/clouldtree"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="integer"

android:textStyle="bold"

android:textSize="30dp"

android:textColor="@color/black" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Character"

android:textStyle="bold"

android:layout_gravity="center"

android:textSize="30dp"

android:textColor="@color/black" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Double"
android:textStyle="bold"

android:layout_gravity="bottom"

android:textSize="30dp"

android:textColor="@color/black" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Float"

android:textStyle="bold"

android:layout_gravity="center_horizontal"

android:textSize="30dp"

android:textColor="@color/black" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="String"

android:textStyle="bold"

android:layout_gravity="right"

android:textSize="30dp"

android:textColor="@color/black"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Array"

android:textStyle="bold"

android:layout_gravity="center_vertical"

android:textSize="30dp"

android:textColor="@color/white"/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="Structure"
android:textStyle="bold"

android:layout_gravity="right|center_vertical"

android:textSize="30dp"

android:textColor="@color/black" />

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="union"

android:textColor="@color/black"

android:textStyle="bold"

android:layout_gravity="right|bottom|center_vertical"

android:textSize="30dp”/>

<TextView

android:layout_width="wrap_content"

android:layout_height="wrap_content"

android:text="pointer"

android:textStyle="bold"

android:layout_gravity="bottom|center_horizontal"

android:textSize="30dp"

android:textColor="@color/black" />

</FrameLayout>

Output:

You might also like