Practical No 14
Practical No 14
XML Code –
<?xml version="1.0" encoding="utf-8"?>
<!-- The outer ScrollView allows the entire content to be scrollable -->
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/imageView"
android:layout_width="match_parent"
android:layout_height="200dp"
android:src="@drawable/sample_image"
android:scaleType="centerCrop"
android:layout_marginBottom="16dp" />
</LinearLayout>
</ScrollView>
JAVA Code –
package com.example.checkbox;
import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.GridView;
import android.widget.ImageView;
import android.widget.ListView;
import androidx.appcompat.app.AppCompatActivity;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Output –