Skip to content

Instantly share code, notes, and snippets.

@quickgrid
Created March 24, 2016 09:33
Show Gist options
  • Save quickgrid/c281f62820bbad0a1fdd to your computer and use it in GitHub Desktop.
Save quickgrid/c281f62820bbad0a1fdd to your computer and use it in GitHub Desktop.
It is a layout file example showing implementation of multple scroll views.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:orientation="vertical"
tools:context="com.blogspot.quickgrid.scrollviewexample.MainActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="200dp"
android:paddingTop="20dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button1"
android:text="something 1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button2"
android:text="something 2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button3"
android:text="something 3"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button4"
android:text="something 4"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button5"
android:text="something 5"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button6"
android:text="something 6"/>
</LinearLayout>
</ScrollView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below"
android:paddingTop="20dp" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="200dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button7"
android:text="something 1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button8"
android:text="something 2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button9"
android:text="something 3"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button10"
android:text="something 4"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button11"
android:text="something 5"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Scroll View Below" />
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/button12"
android:text="something 6"/>
</LinearLayout>
</ScrollView>
</LinearLayout>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment