【发布时间】:2018-11-02 04:14:28
【问题描述】:
我有一个布局,并尝试使其内部的组件可滚动,它应该能够滚动 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 查看器和列表视图,一起,但它不起作用,我只能滚动我的 listView 和 @987654324 @分别
【问题讨论】:
-
你必须使用 - android.support.v4.widget.NestedScrollView 进行滚动。
-
您可以使用
NonscrollableListview。并使用nestedscrollview 而不是scrollview
标签: android android-layout android-studio android-fragments scrollview