Scrollview中的动画ExpandableListView

时间:2016-01-21 06:07:39

标签: android android-studio

我正在尝试在ScrollView布局中实现Animated ExpandableListview。但是当我扩展某个类别时,Scroll就无法工作了。如果有任何方法,那么请帮助我。 提前谢谢!

这是我的xml代码:

<ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_below="@+id/nav_header_container"
        android:overScrollMode="never"
        android:scrollbars="none">

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

            <LinearLayout
                android:id="@+id/ll_home_category"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@drawable/layout_press_color"
                android:orientation="horizontal"
                android:padding="@dimen/standard_padding">


                <ImageView
                    android:id="@+id/item_header_image"
                    android:layout_width="25dp"
                    android:layout_height="25dp"
                    android:layout_centerVertical="true"
                    android:src="@drawable/ic_home" />

                <com.vrin.sga.uc.TextView_Open_Sans_Light
                    android:id="@+id/txt_category"
                    style="@style/Normal_Textview_White"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:layout_marginLeft="@dimen/standard_padding"
                    android:text="Home"
                    android:textColor="@color/black" />

            </LinearLayout>

            <View
                android:id="@+id/view"
                android:layout_width="260dp"
                android:layout_height="1dp"
                android:layout_below="@+id/ll_home_category"
                android:background="@color/line_seperator" />

            <com.vrin.sga.widget.AnimatedExpandableListView
                android:id="@+id/left_drawer"
                android:layout_width="260dp"
                android:layout_height="match_parent"
                android:layout_below="@+id/view"
                android:layout_gravity="start"
                android:childDivider="@null"
                android:choiceMode="singleChoice"
                android:divider="@null"
                android:groupIndicator="@null"
                android:listSelector="@drawable/selector_category"
                android:overScrollMode="never"
                android:scrollbars="none"/>

            <View
                android:id="@+id/view_seperator"
                android:layout_width="fill_parent"
                android:layout_height="1dp"
                android:layout_below="@+id/left_drawer"
                android:layout_marginBottom="10dp"
                android:background="@color/line_seperator"
                android:orientation="horizontal" />

            <LinearLayout
                android:id="@+id/ll_categories"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:background="@color/light_black">

                <com.vrin.sga.uc.TextView_Open_Sans_Light
                    android:id="@+id/txtCategory"
                    style="@style/Normal_Textview_White"
                    android:layout_width="fill_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="3dp"
                    android:padding="8dp"
                    android:text="@string/category"
                    android:textAllCaps="true" />
            </LinearLayout>

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

1 个答案:

答案 0 :(得分:0)

使用这种方法希望它可以帮助你...!

left_drawer.setOnTouchListener(new View.OnTouchListener() {
        @Override
        public boolean onTouch(View v, MotionEvent event) {
            v.getParent().requestDisallowInterceptTouchEvent(true);
            return false;
        }
    });