首页 > 解决方案 > ScrollView 不显示 Homefragment 中的所有内容

问题描述

我正在尝试禁用滚动视图并显示主页中的所有内容,但是直到没有运气滚动才显示所有内容。我已经尝试了有关此的所有问题,但仍然没有运气。如果有人可以帮助我,我将不胜感激。谢谢你:)

这是fragment_home.xml ..

    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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:background="@color/bg">

    <ProgressBar
        android:id="@+id/progressBar"
        style="@style/Widget.AppCompat.ProgressBar"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:visibility="gone" />

    <ScrollView
        android:id="@+id/scrollView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1" >

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

            <FrameLayout
                android:id="@+id/ContainerSlider"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <android.support.v7.widget.RecyclerView
                android:id="@+id/rv_latest"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="5dp" />

            <android.support.v7.widget.RecyclerView
                android:id="@+id/rv_featured"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_margin="5dp" />

        </LinearLayout>
    </ScrollView>


</RelativeLayout>

标签: androidandroid-layoutandroid-fragmentsandroid-xml

解决方案


使用来自 airbnb 的库 EPOXY 可以很好地处理您的布局。会让你的生活轻松很多。 https://github.com/airbnb/epoxy


推荐阅读