以下是activitymain
的内容
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="@color/colorPrimaryDark"
android:elevation="40dp"
/>
</android.support.design.widget.AppBarLayout>
<include layout="@layout/content_main"/>
</LinearLayout>
以下是content_main
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
tools:showIn="@layout/activity_main"
tools:context="info.androidhive.cardview.MainActivity"
android:background="@color/viewBg">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<CustomView
android:id="@+id/slider"
android:layout_width="match_parent"
custom:pager_animation="Accordion"
custom:auto_cycle="true"
custom:indicator_visibility="visible"
custom:pager_animation_span="1100"
android:layout_height="200dp"/>
<CustomView
android:id="@+id/custom_indicator"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
custom:selected_color="#0095BF"
custom:unselected_color="#55333333"
custom:selected_drawable="@drawable/bird"
custom:shape="oval"
custom:selected_padding_left="5dp"
custom:selected_padding_right="5dp"
custom:unselected_padding_left="5dp"
custom:unselected_padding_right="5dp"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
custom:selected_width="6dp"
custom:selected_height="6dp"
custom:unselected_width="6dp"
custom:unselected_height="6dp"
android:layout_marginBottom="20dp"
/>
<CustomView
android:id="@+id/custom_indicator2"
style="@style/AndroidImageSlider_Corner_Oval_Orange"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
/>
<RelativeLayout
android:layout_below="@+id/slider"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/first"
android:layout_marginTop="10dp">
<TextView android:id="@+id/titleOne"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Top Ten Songs"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:textColor="#000"
android:textStyle="bold"
/>
<Button
android:id="@+id/btnMore"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:theme="@style/MyButton"
android:text="See More..."
android:textColor="#FFF" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/horizontal_recycler_view"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:scrollbars="none"
android:layout_marginBottom="10dp"
android:layout_marginTop="10dp"
android:layout_below="@+id/first"/>
<RelativeLayout
android:layout_below="@+id/horizontal_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/second"
android:layout_marginTop="10dp">
<TextView android:id="@+id/titleTwo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Top Ten Songs"
android:layout_alignParentStart="true"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:textColor="#000"
android:textStyle="bold"
/>
<Button
android:id="@+id/btnMores"
android:layout_width="wrap_content"
android:layout_height="42dp"
android:layout_alignParentEnd="true"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:theme="@style/MyButton"
android:text="See More..."
android:textColor="#FFF" />
</RelativeLayout>
<android.support.v7.widget.RecyclerView
android:layout_below="@+id/second"
android:id="@+id/vertical_recycler_view"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clipToPadding="false"
android:scrollbars="vertical" />
</RelativeLayout>
</LinearLayout>
</ScrollView>
我已在活动主体中包含内容主要内容。 内容主要有两个回收者的意见。一个回收者视图是水平回收视图。第二个Recyclerview是垂直回收者视图。
问题是滚动速度太慢。并且scrollview不会在单个实例上滚动到页面的末尾。我该如何解决这个问题呢?