I'm pretty new in android and I'm developing an app but I have an error that's driving me crazy. The thing is that it doesn't scroll completely, it leaves a button out of the screen so it cant 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 anyone could help me, Thanks
Try replacing the ScrollView
with a android.support.v4.widget.NestedScrollView
Make the ScrollView
the root of your layout, instead of using the LinearLayout
, or try to use android.support.v4.widget.NestedScrollView
instead.
try to add android:windowSoftInputMode="adjustResize" to your activity tag manifest file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With