XML : Scrollview won't scroll even when keypad appears

When the keypad appears when the user clicks on an EditText, parts of the layout is covered by the keypad. So I tried using ScrollView so the user can scroll down and see the rest of the layout. But its not scrolling. I can't seem to get my scroll view working. The I have searched on stackoverflow for the solution for 3 hours and couldn't find it.

  <?xml version="1.0" encoding="utf-8"?>  <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"              android:layout_width="match_parent"              android:layout_height="match_parent"              android:fillViewport="true">        <RelativeLayout          android:id="@+id/new_meal_form_relative"          android:layout_width="match_parent"          android:layout_height="match_parent">            <TextView              android:id="@+id/meal_label"              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:layout_alignParentTop="true"              android:layout_marginLeft="2dp"              android:text="@string/meal_label"              android:textSize="20sp"              android:textIsSelectable="false"              android:textStyle="bold"/>            <EditText              android:id="@+id/meal_name"              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:layout_below="@id/meal_label"              android:hint="Event Title"              android:inputType="textCapSentences"              android:maxLines="1"/>            <EditText              android:id="@+id/meal_location"              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:layout_below="@id/meal_name"              android:hint="Location(eg: CSC Room232)* "              android:inputType="textCapSentences"              android:maxLines="1"/>            <EditText              android:id="@+id/meal_event"              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:layout_below="@id/meal_location"              android:gravity="top"              android:hint="Description of the event. What kind of food. Any additional info... \n"              android:inputType="textMultiLine|textCapSentences"/>            <TextView              android:id="@+id/textViewRating"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:layout_below="@id/meal_event"              android:text="Rating: "/>            <Spinner              android:id="@+id/rating_spinner"              android:layout_width="71dp"              android:layout_height="47dp"              android:layout_alignTop="@+id/textViewRequired"              android:layout_toRightOf="@+id/textViewRating"/>            <TextView              android:id="@+id/textViewRequired"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:layout_alignBottom="@+id/textViewRating"              android:layout_alignParentRight="true"              android:layout_gravity="right"              android:text="*Required"                android:textColor="#ffff4b48"              android:textSize="15sp"/>            <com.parse.ParseImageView              android:id="@+id/meal_preview_image"              android:layout_width="wrap_content"              android:layout_height="100dp"              android:layout_below="@+id/rating_spinner"              android:layout_centerHorizontal="true"/>            <ImageButton              android:id="@+id/photo_button"              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:src="@drawable/ic_action_photo"              android:layout_below="@+id/meal_preview_image"/>            <Button              android:id="@+id/save_button"              android:layout_width="fill_parent"              android:layout_height="wrap_content"              android:layout_alignParentLeft="true"              android:layout_below="@+id/photo_button"              android:layout_toLeftOf="@+id/cancel_button"              android:background="#ffff001f"              android:text="@string/post_button_text"/>            <Button              android:id="@+id/cancel_button"              android:layout_width="wrap_content"              android:layout_height="wrap_content"              android:layout_alignParentRight="true"                android:layout_below="@+id/photo_button"              android:text="@string/cancel_button_text"/>            <Space              android:layout_width="20px"              android:layout_height="20px"              android:layout_alignParentBottom="true"              android:layout_toRightOf="@+id/rating_spinner"              android:id="@+id/space"/>            <EditText              android:layout_width="match_parent"              android:layout_height="wrap_content"              android:id="@+id/editText"              android:layout_alignParentBottom="true"              android:layout_alignParentLeft="true"/>        </RelativeLayout>  </ScrollView>    

I have also tried adding "adjustResize" to the manifest file but it didn't do anything.

  android:windowSoftInputMode="adjustResize"    

No comments:

Post a Comment