Не могу прокрутить мой LinearLayout - PullRequest
0 голосов
/ 23 мая 2018

У меня есть макет, и я пытаюсь сделать компоненты внутри него прокручиваемыми, он сможет прокручивать listView и Pdf-View, а также сможет прокручивать ListView и Pdf-View вместе

<?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> 

Я хочу "прокрутить" мой PDF-Viewer и Listview, вместе , но это не работает, я могу только прокрутить мои listView и pdf-view по отдельности

1 Ответ

0 голосов
/ 23 мая 2018

Поскольку представление списка имеет собственный вид прокрутки, вы не можете добавить его в другое представление прокрутки, поэтому вы должны использовать их изолированно

...