13

My layout looks like this:

<RelativeLayout>
    <RelativeLayout>
    </RelativeLayout>
    <ViewFlipper>
        <ScrollView>
            <LinearLayout>
                <EditText />
            </LinearLayout>
        </ScrollView>
    </ViewFlipper>
    <RelativeLayout>
    </RelativeLayout>
</RelativeLayout>

When focused on the EditText in the middle, the soft keyboard pops up as expected, However it always resizes the layout even though I have android:windowSoftInputMode="adjustPan" in the manifest.

The problem with resizing is that only the ScrollView shrinks, leaving the RelativeLayouts above and below it intact, which can almost completely obscure the EditText.

I've tried hiding the RelativeLayouts when the keyboard is shown (that's another sad story), but adjustPan sounds more suitable. However it has no effect on this activity.

How can I force adjustPan to work despite the presence of the ScrollView?

Update:

SO won't let me answer my own question, but the solution is setting android:isScrollContainer="false" on the ScrollView.

Undroid
  • 151
  • 2
  • 6

2 Answers2

0

Good question mostly Developers do the same thing but this is not a correct way you have need to do. This will help you.

 <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
 android:layout_width="fill_parent"
 android:layout_height="fill_parent"
 android:orientation="vertical">


<ViewFlipper>
    <ScrollView
      android:layout_width="fill_parent"
       android:layout_height="fill_parent"
       >
        <LinearLayout
          android:layout_width="fill_parent"
           android:layout_height="wrap_content"
           android:orientation="vertical"
        >
            <EditText />
        </LinearLayout>
    </ScrollView>
</ViewFlipper>
<LinearLayout> 

You should take LinearLayout with orientation as Vertical or horizontal view where you have never adjustment problem created.this is very simple.

bart
  • 2,378
  • 2
  • 19
  • 21
-2

try this in your manifest's the activity tag:

android:windowSoftInputMode="stateVisible|adjustPan"
Ishtiaq
  • 1,206
  • 9
  • 18
  • 5
    According to android documentation you should not use adjustResize & adjustPan tag together. It should be one or the other. – Rise Nov 30 '12 at 11:50