7

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

1

4 Answers 4

6

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

Sign up to request clarification or add additional context in comments.

1 Comment

1

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

1 Comment

I believe you have to ask a new question with your specific implementation details.
1

try to add android:windowSoftInputMode="adjustResize" to your activity tag manifest file

1 Comment

I hava some EditText in ScrollView.I works for me, use adjustResize.thx
0

I got the solution.Replace your container (Relativelayout to 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>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.