Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

多次滑动后滑动异常,无法滑动 #2

Open
moonstr opened this issue Mar 21, 2019 · 4 comments
Open

多次滑动后滑动异常,无法滑动 #2

moonstr opened this issue Mar 21, 2019 · 4 comments

Comments

@moonstr
Copy link

moonstr commented Mar 21, 2019

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appbar_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        app:elevation="0dp"
        app:layout_behavior="com.zygl.donehaitao.widgets.FixAppBarLayoutBehavior"

        >

       <!--  <android.support.design.widget.CollapsingToolbarLayout
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             app:layout_scrollFlags="scroll|enterAlways"
             android:fitsSystemWindows="true">-->

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_scrollFlags="scroll|enterAlways"
            >

            <ImageView
                android:id="@+id/iv_goods_image"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:scaleType="fitXY"
                android:adjustViewBounds="true"/>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="3"
                    android:background="@mipmap/price_bg"
                    android:orientation="vertical"
                    android:paddingLeft="16dp"
                    android:paddingTop="8dp"
                    android:paddingRight="8dp"
                    android:paddingBottom="8dp">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical">

                        <TextView
                            android:id="@+id/tv_price"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="¥  158"
                            android:textColor="@color/white"
                            android:textSize="18sp"
                            android:textStyle="bold" />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:padding="2dp"
                            android:layout_alignParentRight="true"
                            android:background="@drawable/limit_time_bg"
                            android:text="限时促销"
                            android:textColor="@color/white"
                            android:textSize="14sp" />
                    </RelativeLayout>

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:gravity="center_vertical">

                        <TextView
                            android:id="@+id/old_price"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:text="原价"
                            android:visibility="gone"
                            android:textColor="@color/white"
                            android:textSize="14sp" />

                        <TextView
                            android:id="@+id/tv_old_price"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_toRightOf="@id/old_price"
                            android:text="¥  158"
                            android:textColor="@color/white"
                            android:textSize="14sp" />

                        <TextView
                            android:id="@+id/tv_integral"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_alignParentRight="true"
                            android:text="可获得D1积分:72"
                            android:textColor="@color/white"
                            android:textSize="14sp" />
                    </RelativeLayout>

                </LinearLayout>

                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="2"
                    android:background="#feaeae"
                    android:gravity="center_horizontal">

                    <LinearLayout
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center_vertical"
                        android:gravity="center_horizontal"
                        android:orientation="vertical">

                        <TextView
                            android:id="@+id/time_type"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:gravity="center_horizontal"
                            android:text="距离结束"
                            android:textColor="@color/support_color_2" />

                        <LinearLayout
                            android:id="@+id/time_linear"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/txt_time_label"
                            android:layout_marginTop="5dp"
                            android:orientation="horizontal">

                            <TextView
                                android:id="@+id/time_day"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="00"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="天"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                            <TextView
                                android:id="@+id/time_hour"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="00"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="小时"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                            <TextView
                                android:id="@+id/time_minute"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="00"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="分"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                            <TextView
                                android:id="@+id/time_second"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="00"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:text="秒"
                                android:textColor="@color/support_color_2"
                                android:textSize="14sp" />

                        </LinearLayout>
                    </LinearLayout>


                </LinearLayout>
            </LinearLayout>

            <TextView
                android:id="@+id/title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:paddingLeft="16dp"
                android:paddingRight="16dp"
                android:paddingTop="16dp"
                android:text=""
                android:textColor="@color/text_40"
                android:textSize="16sp"/>

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

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:padding="16dp"
                    android:text="请选择规格" />

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="16dp"
                    android:layout_marginRight="16dp"
                    android:layout_marginBottom="16dp"
                    android:background="@drawable/shop_size_bg"
                    android:padding="8dp">

                    <com.zhy.view.flowlayout.TagFlowLayout
                        android:id="@+id/flow_layout"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        app:max_select="1"></com.zhy.view.flowlayout.TagFlowLayout>
                </RelativeLayout>
            </LinearLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="8dp"
                android:background="@color/text_ee" />

            <RelativeLayout
                android:id="@+id/rl_taxes"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="16dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="税费"
                    android:textColor="@color/text_7f"
                    android:textSize="14sp" />

                <TextView
                    android:id="@+id/tv_taxes"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:drawableRight="@mipmap/goods_detail_more"
                    android:drawablePadding="4dp"
                    android:gravity="center_vertical"
                    android:text="¥72"
                    android:textColor="@color/main_color"
                    android:textSize="14sp" />
            </RelativeLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@color/text_ee" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="16dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="配送"
                    android:textColor="@color/text_7f"
                    android:textSize="14sp" />

                <TextView
                    android:id="@+id/address"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:drawableRight="@mipmap/goods_detail_more"
                    android:drawablePadding="4dp"
                    android:text=""
                    android:textColor="@color/text_40"
                    android:textSize="14sp" />
            </RelativeLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@color/text_ee" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:padding="16dp">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="运费"
                    android:textColor="@color/text_7f"
                    android:textSize="14sp" />

                <TextView
                    android:id="@+id/fare"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_alignParentRight="true"
                    android:text="16"
                    android:textColor="@color/main_color"
                    android:textSize="14sp" />
            </RelativeLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="8dp"
                android:background="@color/text_ee" />

            <android.support.v7.widget.LinearLayoutCompat
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:layout_marginTop="8dp"
                android:layout_marginBottom="8dp"
                android:gravity="center_vertical"
                android:orientation="horizontal">

                <View
                    android:layout_width="64dp"
                    android:layout_height="1dp"
                    android:background="@color/text_bf" />

                <android.support.v7.widget.AppCompatTextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="8dp"
                    android:layout_marginRight="8dp"
                    android:text="图文详情"
                    android:textSize="14sp"
                    android:textColor="@color/text_40"/>

                <View
                    android:layout_width="64dp"
                    android:layout_height="1dp"
                    android:background="@color/text_bf" />
            </android.support.v7.widget.LinearLayoutCompat>
            <TextView
                android:id="@+id/desc"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:paddingLeft="16dp"
                android:paddingRight="16dp"
                android:paddingBottom="16dp"
                android:text="16"
                android:textColor="@color/text_7f"
                android:textSize="14sp" />
            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@color/text_ee" />

        </LinearLayout>

        <!--   </android.support.design.widget.CollapsingToolbarLayout>

-->
</android.support.design.widget.AppBarLayout>

@yuruiyin
Copy link
Owner

@moonstr 我把你代码拷贝下来,运行一下滑动几下没毛病。

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/white"
    >

    <android.support.design.widget.AppBarLayout
        android:id="@+id/appBarLayout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        app:elevation="0dp"
        app:layout_behavior="com.yuruiyin.appbarlayoutbehavior.AppBarLayoutBehavior"
        >
        
        // 你的布局
        
        <!-- 需要悬停的布局:玩家评价title -->
        <net.lucode.hackware.magicindicator.MagicIndicator
            android:id="@+id/magicIndicator"
            android:layout_width="match_parent"
            android:layout_height="@dimen/common_tab_height"
            android:layout_gravity="left"
            android:background="@color/white"
            android:visibility="visible"/>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.3dp"
            android:background="#aaaaaa"
            />

    </android.support.design.widget.AppBarLayout>

    <android.support.v4.widget.NestedScrollView
        android:id="@+id/nestedScrollview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <android.support.v4.view.ViewPager
            android:id="@+id/viewPager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"/>

    </android.support.v4.widget.NestedScrollView>

</android.support.design.widget.CoordinatorLayout>

@yuruiyin
Copy link
Owner

@moonstr 你那边试试跑我的demo,会出现多次滑动后无法滑动的问题吗?

@beibeiandroid
Copy link

这个问题我也发现了 但是没必现 这样使用还是很大风险的

@LPTim
Copy link

LPTim commented Feb 14, 2021

和手机有关,在不同品牌手机会出现滑动异常情况

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants