我想放一个RecyclerView
,里面一个ScrollView
。但是ScrollView
不滚动并且RecyclerView
是的,但我不希望它...我能做什么?
我尝试过这门课https://stackoverflow.com/a/30222721/4864104而事实上RecyclerView
不再滚动,但也不再滚动ScrollView
.
任何帮助使ScrollView
甚至与残疾人一起工作RecyclerView
?提前致谢。
这是我的布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:fab="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="jahirfiquitiva.projects.activities.DeveloperActivity">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<ScrollView
android:id="@+id/osv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/toolbar"
android:fillViewport="true"
android:gravity="center"
android:overScrollMode="never">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="10dp">
<ImageView
android:id="@+id/photoJahir"
android:layout_width="144dp"
android:layout_height="144dp"
android:layout_gravity="center"
android:gravity="center" />
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:lineSpacingMultiplier="1.2"
android:paddingBottom="@dimen/lists_padding"
android:paddingTop="@dimen/lists_padding"
android:text="@string/developer_bio"
android:textSize="@dimen/abc_text_size_subtitle_material_toolbar" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dividers_about_section"
android:alpha="0.3"
android:background="@color/primary" />
<RecyclerView
android:id="@+id/buttonsGrid"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/lists_padding"
android:paddingTop="@dimen/lists_padding" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dividers_about_section"
android:alpha="0.3"
android:background="@color/primary" />
<View
android:layout_width="match_parent"
android:layout_height="72dp" />
</LinearLayout>
</ScrollView>
您可以通过将滚动视图更改为嵌套滚动视图和设置recyclerView.setNestedScrollingEnabled(false)
具有最高的性能并且无需覆盖布局管理器。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)