scrollview中的ViewPager不会在布局

时间:2017-02-16 15:59:28

标签: android android-viewpager scrollview

我在scrollView中有一个viewpager,其中有很多其他组件,但是viewpager不会在布局中滚动,解决方案是什么?我想滚动所有页面而不仅仅是viewpager,什么是解决方案?

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#E3E3E3"
android:orientation="vertical">



<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
    android:id="@+id/scroll">
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

        <RelativeLayout
            android:id="@+id/sliderLayout"
            android:layout_width="match_parent"
            android:layout_height="230dp">

            <com.daimajia.slider.library.SliderLayout
                android:id="@+id/slider"
                android:layout_width="match_parent"
                android:layout_height="230dp"
                custom:auto_cycle="true"
                custom:indicator_visibility="visible"
                custom:pager_animation="Accordion"
                custom:pager_animation_span="1100" />

            <com.daimajia.slider.library.Indicators.PagerIndicator
                android:id="@+id/custom_indicator"
                style="@style/AndroidImageSlider_Magnifier_Oval_Black"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_alignParentLeft="true"
                android:layout_marginBottom="5dp"
                android:layout_marginLeft="12dp"
                android:gravity="center"
                android:layoutDirection="rtl"
                android:textDirection="rtl"
                custom:selected_color="#ededed"
                custom:selected_padding_left="5dp"
                custom:selected_padding_right="5dp"
                custom:shape="oval"
                custom:unselected_color="#ededed"
                custom:unselected_padding_left="5dp"
                custom:unselected_padding_right="5dp" />

            <com.daimajia.slider.library.Indicators.PagerIndicator
                android:id="@+id/custom_indicator2"
                style="@style/AndroidImageSlider_Corner_Oval_Orange"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:layout_marginBottom="20dp"
                android:layoutDirection="rtl"
                android:textDirection="rtl" />

            <ListView
                android:id="@+id/transformers"
                android:layout_width=".1dp"
                android:layout_height=".1dp"
                android:layout_below="@+id/slider"
                android:visibility="gone" />
        </RelativeLayout>


        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="7dp">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginTop="30dp"
                android:background="#fcfcfc"
                android:orientation="vertical">


                <android.support.design.widget.TabLayout
                    android:id="@+id/tab_layout"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_below="@+id/app_bar"
                    android:layout_marginLeft="19dp"
                    android:layout_marginRight="19dp"
                    android:layout_marginTop="50dp"
                    android:background="@drawable/textlines"
                    android:elevation="6dp"
                    android:minHeight="?attr/actionBarSize"
                    custom:tabIndicatorColor="#4FCCA2"
                    custom:tabSelectedTextColor="#3dbCA2"
                    custom:tabTextColor="#b7b7b7" />


                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="7dp"
                    android:orientation="vertical">

                    <android.support.v4.view.ViewPager
                        android:id="@+id/pager"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_below="@id/tab_layout" />

                </LinearLayout>

...

0 个答案:

没有答案