滚动视图中的动画

滚动视图中的动画

本文介绍了滚动视图中的动画 ExpandableListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 ScrollView 布局中实现 Animated ExpandableListview.但是当我扩展某个类别时,Scroll 不起作用.如果有任何方法,请帮助我.提前致谢!

I am trying to implement Animated ExpandableListview in ScrollView layout. But when I expand some category then Scroll is not working. If any method for this then Please help me.Thanks in advance!

这是我的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>

推荐答案

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

use this method hope it may helps you out..!

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

这篇关于滚动视图中的动画 ExpandableListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 09:33