Aspsine/SwipeToLoadLayout

有个问题

wenchaosong opened this issue · 0 comments

如果设置 listview 空视图,上下滑动的时候会出现 只显示底部 item,上面的 item 都被遮住 的情况(必现).

解决办法: 继续嵌套一层本身可以滑动的 viewgroup (蛋疼 = =)

     <ScrollView
        android:id="@id/swipe_target"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:scrollbars="none">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">

            <com.component.common.CustomListView
                android:id="@+id/activity_mine_daikuan_recyclerview"
                android:layout_width="match_parent"
                android:layout_height="match_parent" />

            <com.component.common.EmptyView
                android:id="@+id/activity_mine_daikuan_emptyview"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:visibility="gone" />
        </LinearLayout>

    </ScrollView>

当然还有其他的办法,比如重写 getItemViewType 根据不同的 type 返回不同的布局,这样就可以只嵌套一个 listview 或者 recyclerview