Scrollview not fully scrollable in Snippet, Android

I am new to android and I am developing an application, but I have a bug that drives me crazy. The fact is that it does not scroll completely, it leaves a button on the screen, so it cannot be seen.

Here is the xml code:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#d3d3d3" android:orientation="vertical"> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:fillViewport="true" > <LinearLayout android:orientation="vertical" android:background="@drawable/bg_sugerir" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="10dp" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:id="@+id/linearLayout" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageView" android:src="@drawable/pd" android:layout_marginBottom="15dp" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/editText" android:layout_marginBottom="15dp" android:hint="Nombre" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:inputType="phone" android:ems="10" android:id="@+id/editText2" android:layout_marginBottom="15dp" android:hint="Teléfono" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/editText4" android:layout_marginBottom="15dp" android:hint="Provincia" /> <EditText android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/editText3" android:layout_marginBottom="15dp" android:hint="Descripción" /> <Button android:layout_width="match_parent" android:layout_height="wrap_content" android:text="Enviar" android:id="@+id/button" /> </LinearLayout> </ScrollView> </LinearLayout> 

It shows the following, but as shown, the button is not there: notScrolling

Hope someone can help me, thanks

+5
source share
4 answers

Try replacing ScrollView with android.support.v4.widget.NestedScrollView

+4
source

Make the ScrollView root of your layout instead of using LinearLayout or try using android.support.v4.widget.NestedScrollView instead.

0
source

I got a solution. Replace the container (Relativelayout with scrollview).

 <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.exampl.nitish.complteproject.MainActivity"> enter code here </ScrollView> 
0
source

try adding android: windowSoftInputMode = "adjustResize" to the manifest file of your action

-1
source

Source: https://habr.com/ru/post/1245806/


All Articles