Ich habe eine HorizontalScrollView in einem VerticalScrollView. Wenn ich horizontal scrolle, ist das Scrollen sanft. Aber wenn ich vertikal scrollen, ist die Bildlauf nicht glatt, es wird manchmal horizontal gescrollt. Wie macht man die vertikale Bildlauf glatt?HorizontalScrollView in einem ScrollView Android
Hier ist meine xml,
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.sasank.calendarview.MainActivity"
android:background="@android:color/white">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World!" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="500dp"
android:layout_marginLeft="200dp"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/chapter_list"
android:layout_width="150dp"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
<HorizontalScrollView
android:id="@+id/horizontal_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_toRightOf="@id/chapter_list"
android:scrollbars="horizontal">
<android.support.v7.widget.RecyclerView
android:id="@+id/calendar"
android:layout_width="wrap_content"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</HorizontalScrollView>
</RelativeLayout>
</ScrollView>
</RelativeLayout>
</RelativeLayout>
Im einen Vertical LinearLayoutManager für Chapter_list Recyclerview und GridLayoutManager für Kalender RecyclerView
nicht sicher, ob es noch festgelegt wurde, aber Verschachtelung der Scroll der wird nicht unterstützt oder empfohlen. Aus diesem Grund musste ich einen benutzerdefinierten Kalender erstellen. – samosaris