1

I have a layout and try to make the components inside it scrollable, it shall be able to scroll the listView and Pdf-View and also it shall be able to scroll the ListView and Pdf-View together

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout 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"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        tools:context=".uiFragments.HerstellerunterlagenInstandhalterFragment">

    <ScrollView 
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="2dp"
                android:layout_marginBottom="2dp"
                android:layout_marginLeft="10dp"
                android:layout_marginRight="10dp"
                android:background="@drawable/back"
                android:layout_gravity="center_horizontal"
                android:orientation="vertical">

                <ListView
                    android:id="@+id/listview_anlagenuebersicht_instandhalter"
                    android:layout_marginTop="1dp"
                    android:layout_marginBottom="1dp"
                    android:layout_marginLeft="1dp"
                    android:layout_marginRight="1dp"
                    android:listSelector="@drawable/bkg"
                    android:background="@android:color/white"
                    android:layout_height="70dp"
                    android:layout_width="650dp"/>
            </LinearLayout>

            <com.github.barteksc.pdfviewer.PDFView
                android:id="@+id/pdfView_anlage"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="100dp"/>

         </LinearLayout>
    </ScrollView>
</FrameLayout> 

I want to "scroll" my PDF-Viewer and Listview, together, but it does not work, I can only scroll my listView and the pdf-view separately

Josi Allen
  • 137
  • 2
  • 10

2 Answers2

1

You can use android:isScrollContainer="true". It will indicate that the view is one of the set of scrollable containers in its window. For more read this https://developer.android.com/reference/android/view/View

0

Because list view has its own scroll view you can not add it inside another scroll view so you must use them isolated

Reza M
  • 3
  • 3