1

I have sort of a login fragment, on top of which is a "back" button (a text view) and under it is a scroll view with text inputs. When i click on one of them the keyboard appears and shifts everything upwards. However, i want the back button to be always visible. How can i achieve this?

I tried playing with windowSoftInputMode but didnt get the desired result.

<RelativeLayout
    android:id="@+id/backC"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    >

    <TextView
        android:id="@+id/backbutton"
        style="@style/backbuttonstyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        />
</RelativeLayout>

<ScrollView
    android:id="@+id/signupscroll"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:layout_below="@id/backC"
    >

    //stuff is here


    </RelativeLayout>
</ScrollView>

Squeazer
  • 1,234
  • 1
  • 14
  • 33

1 Answers1

0

I would not use a TextView as a back button, use the .addToBackStack(null); to accomplish this, that way you don't need it to be visible. See here for information on the method: http://developer.android.com/reference/android/app/FragmentTransaction.html#addToBackStack%28java.lang.String%29

EDIT: If you don't want to get rid of the back button, use "adjustPan", see here: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft for documentation.

ElectronicGeek
  • 3,312
  • 2
  • 23
  • 35