recyclerview下面的TextView不显示 [英] TextViews below recyclerview are not displaying

查看:191
本文介绍了recyclerview下面的TextView不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

未显示RecyclerView下面的TextViews.整个屏幕都被RecyclerView占据.如果我使用Nestedscrollview,则仅显示TextViews,而不显示RecyclerView.请任何人为此提供解决方案

The TextViews Below RecyclerView are not displaying.The whole screen is occupied by RecyclerView.If i use Nestedscrollview only TextViews are displaying but not RecyclerView.Please Anyone provide solution for this

 <LinearLayout
            android:id="@+id/wrapper"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content">

            <android.support.v7.widget.RecyclerView
                android:id="@+id/recycler_view"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:scrollbars="vertical" />

        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_below="@+id/wrapper"
            android:orientation="vertical">


            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="Hello" />


        </LinearLayout>

    </RelativeLayout>

推荐答案

这会将您的屏幕分为两部分,上半部分将由recyclerview覆盖,另一半将由textviews覆盖.

this will divide your screen in two parts first half will be covered by recyclerview and another by textviews.

尝试一下.

<LinearLayout
    android:id="@+id/wrapper"
    android:orientation="vertical"
    android:layout_weight="1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:scrollbars="vertical" />

</LinearLayout>

<LinearLayout
    android:layout_width="match_parent"
    android:layout_weight="1"
    android:layout_height="match_parent"
    android:layout_below="@+id/wrapper"
    android:orientation="vertical">


    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello" />


</LinearLayout>

这篇关于recyclerview下面的TextView不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆