Problem with the android cellphone keyboard

0

I have a problem that when I run my application on Android what happens is that I have some buttons at the bottom of the screen and pressing an EditText appears the keyboard and hides my buttons , I want to know how to do so that the button goes up to the level of the keyboard and in this way does not hide

    
asked by Luis Meneses 10.10.2017 в 23:44
source

2 answers

1

In your layout, place all the content (the EditText and the botones ) within a ScrollView .

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <EditText
            ... />

        <Button>
            ... />

            ...     

    </ScrollView>
</RelativeLayout>
    
answered by 11.10.2017 / 00:39
source
0

The activity that contains the button or buttons in the android manifest adds the following attribute:

android:windowSoftInputMode="adjustResize"

The result would be:

<activity 
    android:windowSoftInputMode="adjustResize"
>

In the xml of the activity that contains the buttons, add this attribute in the layout that contains the button:

 android:fitsSystemWindows="true"

If it is a single layout that contains all the other buttons or textviews, you put it to that, if the button is inside an X layout that in turn is inside another layout And that would be the global, the attribute will go in the layout x, that is, put it in the layout where the buttons are located.

    
answered by 10.10.2017 в 23:53