Instead of View.INVISIBLE try View.GONE.

Invisible = "This view is invisible, but it still takes up space for
layout purposes."

http://developer.android.com/reference/android/view/View.html

Also in your scroll view layout try setting
android:fillViewport="true" on the scroll view.

Ed

On Sep 7, 12:03 am, Mathias Lin <m...@mathiaslin.com> wrote:
> Interestingly though: when I set my ListView visibility to
> View.INVISIBLE in my first activity, then the layout doesn not get
> moved up anymore!
>
> This is my layout/xml:
>
> 1)http://pastebin.com/5zzVxjbK
> ListView where layouts is been moved up by the softkeyboard
>
> 2)http://pastebin.com/KFtPuHvP
> ScrollView/LinearLayout, where layout remains fix by the softkeyboard
>
> On Sep 6, 8:48 pm, Mathias Lin <m...@mathiaslin.com> wrote:
>
>
>
> > How does Android determine whether to move the layout up when showing
> > the softkeyboard?
>
> > Note: I am aware that the activity property
> > android:windowSoftInputMode="adjustResize|adjustResize|
> > adjustUnspecified" exists, as described 
> > herehttp://developer.android.com/guide/topics/manifest/activity-element.h...
> > , but in my case it doesn't seem to have any effect. This is my
> > problem:
>
> > I have two activities, pretty much the same layout, but the first one
> > is using a ListView that holds a list of buttons. The second activity
> > holds a scrollview with buttons. The rest is the same, same number of
> > buttons, same height of elements, etc. (All elements fit on the
> > screen, so actually the user doesn't need to scroll in the scrollview
> > or listview.)
> > Please see my screenshot to get an idea:http://i.imgur.com/UNXPz.png
>
> > Now, when I press the search button to open the search input bar, in
> > my first activity, the entire layouts gets moved up. While on the
> > second activity, the layout is not being moved up but the softkeyboard
> > just displays on top of it. This is actually how I want it to behave.
> > How can I achieve the same with my activity that's using the ListView?
>
> > In my manifest, initially I didn't specify any
> > android:windowSoftInputMode attribute, but even if I do, it doesn't
> > make any difference; I tried all three values (adjustPan,
> > adjustResize, adjustUndefined, without any difference).
>
> > This is my layout:http://i.imgur.com/UNXPz.png
>
> > (I'm not posting any code here for now, I'm more interested generally
> > how it's been exactly determined whether Android moves the layout up
> > or just displays they softkeyboard right on top of the existing layout
> > without moving it.)
>
> > I couldn't find a specific logic that's been followed. When I reduce
> > the number of buttons, when I even wrap the listView in a ScrollView
> > (just for the sake of trying to see what's happening), the layout just
> > won't stay fix.
> > On the other hand then, I have activities in my app that contain only
> > one large ListView, and on that one the layout also remains fixed.
> > First I thought it's related to ListViews, but it seems not to.
>
> > btw: nowhere in my manifest am I explicitly specifying the
> > windowSoftInputMode attribute.

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to