2
I’m using a Linearlayout with a Reciclerview and 3 buttons underneath it.
I’m doing this, but Reciclerview takes up the whole screen and the buttons don’t appear.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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:background="@color/salmao"
tools:context="br.com.robson.boascompras.ListasComprasActivity">
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:scrollbars="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:gravity="center">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/editar"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/excluir"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/nova_lista"/>
</LinearLayout>
</LinearLayout>
Thank you!!! solved my problem! But I was left with a question, I put "android:layout_height="wrap_content" why in my logic I do not know how many elements will be placed in the list, then it would be adjusted according to the content( the amount of items), why this logic is not valid?
– Robson Rodrigues
The reason is that same be "adjusted according to the content( the amount of items)", as the space required to present the content is greater.
– ramaral