微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

android – 我可以像这样创建一个nestedScroll布局吗?

我认为它可以通过nestedScrollingChild nestedScrollingParent来实现.

但我无法理解他们.谁可以帮助我!

产品经理坚持设计.

ScrollView包含LinearLayout,“TabLayout”和ViewPager.

ViewPager包含2个包含RecyclerView的片段或仅包含2个RecyclerView.

当ScrollView滚动到Bottom时,RecyclerView可以滚动到Bottom.

当RecyclerView滚动到Top时,ScrollView可以滚动到Top.

<?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更改为android.support.v4.widget.nestedScrollView即可

如果不起作用,请发布您的xml

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐