tin*_*ght 8 android scrollview android-recyclerview nestedscrollview
我认为它可以通过实现NestedScrollingChild NestedScrollingParent.
但我无法理解他们.谁可以帮助我!
产品经理坚持设计.
该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>
Run Code Online (Sandbox Code Playgroud)
小智 2
\xd9\x90你可以这样做,但是使用这种类型的布局根本不好
\n\n首先,您需要添加 ViewPager 和 RecyclerView 的“wrap_content”功能
\n\n\n\n现在您可以轻松使用滚动视图,将所有项目放入其中
\n\n如果您希望在用户滚动或某些项目在滚动中可见时产生某种效果或某些内容,您可以获取项目的位置,然后在滚动视图的\n“OnScrollChangedListener”上创建侦听器
\n| 归档时间: |
|
| 查看次数: |
414 次 |
| 最近记录: |