ScrollView 嵌套RecyclerView

本文介绍了在Android开发中如何将RecyclerView嵌套在ScrollView内,分别通过使用NestScrollView和ScrollView两种方式。在使用NestScrollView时遇到了界面滑动卡顿且失去惯性滑动的问题,解决方法是调整RecyclerView的设置。而使用ScrollView则是在RelativeLayout中放置RecyclerView,目前在Android 4.4的Pad上运行良好,但对未来可能出现的问题持保留态度。
摘要由CSDN通过智能技术生成

目前使用有两种方法:

1、使用新控件NestScrollView 嵌套RecyclerView,使用方法与一般ScrillView嵌套条目一样

xml:

    <android.support.v4.widget.NestedScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginLeft="30px"
        android:layout_marginRight="30px"
        android:layout_marginTop="25px"
        android:background="@color/white">

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

				<TextView
                    android:id="@+id/title8"
                    android:visibility="invisible"
                    android:layout_width="wrap_content"
                    android:layout
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值