Apr 17, 2021

ScrollView With LinearLayout & Frame LayOut In Android Studio - Androidpro.in

 in this post show an android studio code which code is frame layout inside scrollview.


<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:background="#ffffff"
    tools:context=".MainActivity">

    <LinearLayout
        android:id="@+id/linearLayoutHeader1"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        tools:ignore="MissingConstraints">


        <ScrollView
            android:id="@+id/scrollView1"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_below="@+id/linearLayoutHeader1"
            android:layout_centerHorizontal="true">

            <LinearLayout
                android:id="@+id/LinearLayout1"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <FrameLayout
                    android:layout_marginTop="10dp"
                    android:id="@+id/FrameLayout1"
                    android:layout_width="match_parent"
                    android:background="@color/teal_700"
                    android:layout_height="wrap_content">

                    <ImageView
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:background="#03A9F4"
                        android:layout_height="110dp"
                        android:src="@drawable/download_1"
                        android:layout_marginTop="5dp"
                        >

                    </ImageView>
                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="40dp"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Abrahim Linkin"
                        android:textColor="@color/white"
                        android:layout_marginTop="120dp"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:layout_marginBottom="7dp"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout2"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#F44336">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/download_2"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Abrahim Linkin"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout3"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#9C27B0">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/download_3"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Amitabh Bachhan"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout4"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#E91E63">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/download_4"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="apj abdul kalam"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout5"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#673AB7">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/download_5"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Bill Gates"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout6"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#009688">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/dhirubhai_ambai"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Dhiru Bhai Ambani"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout7"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#009688">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/jack_ma"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Jack Ma"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout8"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#4CAF50">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/milkha"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Milkha Singh "
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout9"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#8BC34A">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/rajiv_dixit"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Rajiv Dixit"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout10"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#FFEB3B">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/ratan_tata"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Ratan Tata"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout11"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#8BC34A">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/sachin_tendulakar"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Sachin Tendulakar"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout12"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#FF9800">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/steve_jobs"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Steve Jobs"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>
                <FrameLayout
                    android:layout_marginTop="5dp"
                    android:id="@+id/FrameLayout13"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#FF5722">

                    <ImageView
                        android:background="#2196F3"
                        android:layout_marginTop="5dp"
                        android:layout_width="200dp"
                        android:layout_gravity="center_horizontal"
                        android:layout_height="110dp"
                        android:src="@drawable/sundar_pechai"
                        >

                    </ImageView>

                    <TextView
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:textSize="25sp"
                        android:textStyle="bold"
                        android:text="Sundar Pechai"
                        android:layout_marginTop="120dp"
                        android:layout_marginBottom="7dp"
                        android:textColor="@color/white"
                        android:textAlignment="center"
                        android:layout_gravity="center_horizontal"
                        android:textAllCaps="true"
                        android:gravity="center_horizontal">

                    </TextView>

                </FrameLayout>


            </LinearLayout>
        </ScrollView>


    </LinearLayout>



</androidx.constraintlayout.widget.ConstraintLayout>

Whatsapp Button works on Mobile Device only