【发布时间】:2018-09-30 01:48:41
【问题描述】:
我在LinearLayout 中有两个RecyclerViews 在ScrollView 中:
<ScrollView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:padding="@dimen/few_value">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<com.foodjoo.fjco.customViews.BYekanFontText
android:id="@+id/market_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:padding="@dimen/normal_plus_value"
android:text=" لبنیات > مارکت پیکی علی "
android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead"
android:textColor="@color/light_black2" />
<android.support.v7.widget.RecyclerView
android:id="@+id/market_cat_recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.foodjoo.fjco.customViews.BYekanFontText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:padding="@dimen/normal_plus_value"
android:text="ساعات کار"
android:textAppearance="@style/Base.TextAppearance.AppCompat.Subhead"
android:textColor="@color/light_black2" />
<android.support.v7.widget.RecyclerView
android:id="@+id/market_hours_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</ScrollView>
两个回收站都有nestedScrollEnabledflase。
问题在这里: 当布局渲染时,第一个 recyclerView 将被填充,屏幕底部的第二个 recyclerView 不会显示所有项目,因为第一个高度! 但它应该滚动,因为它们都在 scrollView 中!
那么问题是什么?
【问题讨论】:
-
你试过移除滚动视图吗?
-
尝试将第二个回收站视图的高度设置为 wrap_content
-
@PierGiorgioMisley 我需要 scrollView 来滚动页面,它不能被移除
-
@ShubhamSrivastava 仍然无法正常工作:(
-
你也可以发布你的活动吗!
标签: android android-layout android-recyclerview nestedrecyclerview