Layout with listview doubts

1

I'm facing a layout problem, in this layout I have a ListView and then I have 3 more buttons, but when the list is too large, it uses the whole size of the screen and I can not see the buttons, can anyone help me?

How the layout is:

<?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:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">



    <EditText
        android:layout_width="match_parent"
        android:inputType="textPersonName"
        android:ems="10"
        android:id="@+id/edtPesquisa"
        android:drawableLeft="@drawable/ic_lupa"
        android:layout_marginTop="15dp"
        android:hint="Pesquisa rápida"
        tools:ignore="HardcodedText,RtlHardcoded,UnusedAttribute"
        android:layout_marginLeft="10dp"
        android:layout_marginRight="10dp"
        android:elevation="1dp"
        android:layout_height="40dp" />

    <ListView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/listDebitosPendentes"
        android:textAppearance="@style/Base.TextAppearance.AppCompat.Small"
        tools:ignore="NestedScrolling"
        android:footerDividersEnabled="false"/>

    <Button
        android:text="Enviar boleto por e-mail"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/enviaBoletoEmail"
        tools:ignore="HardcodedText" />

    <Button
        android:text="@string/enviar_linha_digit_vel_por_sms"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/enviaLinhaDigitavel" />

    <Button
        android:text="@string/mostrar_linha_digit_vel"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/mostraLinhaDigitável" />


</LinearLayout>
    
asked by anonymous 02.12.2016 / 18:23

2 answers

2

Add in ListView weight android:layout_weight="1" in this way the layout will reorganize.

    
02.12.2016 / 18:44
0

You need to use a component called ScrollView

<ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">
        <include layout="@layout/minha_tela_"> </include>
    </ScrollView>

You will basically have two xmls ... one representing the entire layout, and another with that component. In the activity use setContentView in this layout that has the scrollview. (Detail: in that layout that has the scrollview ONLY it will have it. Everything else will be in the layout that I called "my_help")

    
02.12.2016 / 18:36