【发布时间】:2015-07-29 11:39:34
【问题描述】:
我需要在 Scrollview 中使用 Scroll Listview。
Scrollview 有两个子视图,Relative layout 和 Listview
而列表视图正在使用naver's PullToRefresh library。
我想要两个功能
- 向上滚动时,滚动大约一半的相对布局,通过触摸事件传递给列表视图。
- 向下滚动时,如果列表视图显示第一项,则真实布局将完全显示。否则相对布局必须是固定滚动列表视图。如果用户过度滚动,则必须使用下拉刷新。
我有示例截图
https://www.dropbox.com/s/8renmrmw5n8g5em/example.png?dl=0
它实际上在项目中使用,受 NDA 保护。我审查了它。
我曾尝试 requestDisallowInterceptTouchEvent(),它不适合我。
我的布局 xml。
<ScrollView
android:id="@+id/main_doc_scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
android:fillViewport="true">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<include
layout="@layout/main_page_top_scroll_items"
android:layout_height="wrap_content"
android:layout_width="match_parent"/>
<com.handmark.pulltorefresh.library.PullToRefreshListView
xmlns:ptr="http://schemas.android.com/apk/res-auto"
android:id="@+id/main_doc_list"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:cacheColorHint="#00000000"
android:divider="#00FF0000"
android:dividerHeight="0dp"
android:fadingEdge="none"
android:fastScrollEnabled="false"
android:footerDividersEnabled="false"
android:headerDividersEnabled="false"
android:smoothScrollbar="true"
android:scrollbars="none"
ptr:ptrFriction="3.0"
ptr:ptrSmoothScrollDuration="400" />
</LinearLayout>
</ScrollView>
感谢您的友好合作。
【问题讨论】:
-
@DroidWormNarendra 谢谢你的建议,但我试过了,我什么也得不到……
标签: android layout android-listview scrollview