1

I have a fragment of this given layout hierarchy,

enter image description here

Inside the view pager I have a Edit text. When keyboard appears to type in the text to EditText the entire layout is not pushed up. Instead the contents inside ViewPager is pushed up. I want the entire content inside the Outer Linear Layout to be pushed up when keyboard appears.

How can I achieve this?

Thanks.

Zach
  • 9,989
  • 19
  • 70
  • 107

3 Answers3

2

Put your Parent LinearLayout inside a scrollview. This fixed my issue.

android_eng
  • 1,370
  • 3
  • 17
  • 40
1

put your base layout inside the ScrollView

  <ScrollView
    android:id="@+id/scrollView1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:id="@+id/llPlayersName"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
         >
        // do here the layout work
    </LinearLayout>

</ScrollView>

remember scrollView cannon be used as the base layout, so you have to put the scrollView inside the LinearLayout or RelativeLayout.

0

In your activity's manifest entry, add

<activity ...
android:windowSoftInputMode="adjustPan">
shiladitya
  • 2,290
  • 1
  • 23
  • 36