【发布时间】:2016-02-01 22:05:30
【问题描述】:
我认为可以通过NestedScrollingChildNestedScrollingParent来实现。
但我真的无法理解它们。谁能帮帮我!
产品经理坚持设计。
ScrollView 包含一个LinearLayout、一个“TabLayout”和一个ViewPager。
ViewPager 包含 2 个 fragment 包含 RecyclerView 或仅包含 2 个 RecyclerView。
ScrollView 滚动到底部时,RecyclerView 可以滚动到底部。
当RecyclerView 滚动到顶部时,ScrollView 可以滚动到顶部。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:layout_width="match_parent"
android:layout_height="1000dp" />
<TableLayout
android:layout_width="match_parent"
android:layout_height="60dp"></TableLayout>
<android.support.v4.view.ViewPager
android:layout_width="match_parent"
android:layout_height="match_parent"></android.support.v4.view.ViewPager>
</LinearLayout>
</ScrollView>
【问题讨论】:
-
你可以,但它太老套了,而且对用户不友好......我建议重新设计你的应用程序,这样你就不必求助于这个解决方案了。
-
产品经理坚持下去!
-
回击说它愚蠢且技术上错误且违反标准......
-
我不明白你到底想达到什么目的。如果您只想在 ScrollView 中使用 ViewPager,只需将所有内容放入某个布局(线性、相对等)中,然后使用 ScrollView 包装此布局。也许看看
overscrollMode的 RecyclerView 让 Recycler 和 ScrollView 都有滚动 -
viewpager 包含 2 个 recyclerview。我希望他们可以在某个时间滚动。
标签: android scrollview android-recyclerview nestedscrollview