Prevent ListView Android from disappearing

1

Good, I have an interface with 2 LinearLayout, one below the other. The upper one has a pair of TextView and a Button, and the Bottom has a ListView, below a TextView and 2 buttons.

The theme is the following: when I click on the TextViews of my Top Layout, the keyboard for writing automatically appears, pushing the Bottom Layout upwards, this makes the elements that are at the bottom of the ListView (items from the list) are not displayed, leaving only the top 2.

How can I avoid this?

I need, that, in any case, if something should be hidden, be the Buttons that are under the ListView (Those that are being pushed), but the list should remain, whenever possible, Always Visible.

My Activity is the Next:

    <LinearLayout
                android:id="@+id/main"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:baselineAligned="false"
                android:orientation="horizontal"> 

    [...] //Acá están Los TextViews y botones varios

</LinearLayout>

    <LinearLayout
                android:id="@+id/sec"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@+id/main"
                android:gravity="center_horizontal"
                android:orientation="vertical">

    //éste es el Listview del cual desaparecen los items inferiores

                <ListView
                    android:id="@+id/lviewArtaGrabar"
                    android:layout_width="fill_parent"
                    android:layout_height="fill_parent"
                    android:layout_marginBottom="10pt"
                    android:layout_marginTop="10pt"
                    android:layout_weight="1" /> 

    // Y lo de aquí debajo, es lo que prefiero que se oculte

                <Button
                    android:id="@+id/btn_save"
                    android:layout_width="200pt"
                    android:layout_height="wrap_content"
                    android:text="Confirmar Inventario"
                    android:textAlignment="center"
                    tools:ignore="HardcodedText" />

                <TextView
                    android:id="@+id/tv_complete"
                    android:layout_width="200pt"
                    android:layout_height="wrap_content"
                    android:text="Inventario Incompleto"
                    android:textAlignment="center"
                    android:textColor="@android:color/holo_red_light"
                    android:textSize="24sp"
                    android:textStyle="italic"
                    tools:ignore="HardcodedText" />

                <Button
                    android:id="@+id/btn_force_close"
                    android:layout_width="200pt"
                    android:layout_height="wrap_content"
                    android:text="Forzar Inventario Completo"
                    android:textAlignment="center" />

            </LinearLayout>

I think that it is not necessary to clarify that everything is within a RelativeLayout. I'm making an app that is only going to run on a tablet in Landscape mode. That is, as seen in other devices does not matter much.

    
asked by FederHico 08.06.2017 в 20:09
source

0 answers