On Sep 8, 8:58 am, Dianne Hackborn <hack...@android.com> wrote:
> You make a broken view hierarchy that uses fixed sizes, so doesn't adjust to
> the actual window size.  Again, not something I would recommend.

I don't see how non-fixed sizes make a difference here in my case.
I have two activities with an almost identical view hierarchy, where
the most outer LinearLayouts are identical, the very outer one using
android:layout_height="wrap_content" and the next inner one a fixed
size of android:layout_height="480dp".

The only difference between those activities is that in one activity
I'm using

<ScrollView android:id="@+id/category_questions"
android:layout_height="wrap_content"
android:layout_width="fill_parent">

while in the other - at the same corresponding hierarchy level - I'm
using

<ListView android:id="@+id/category_questions"
android:layout_height="fill_parent" android:layout_width="fill_parent"/
>

And that's the only main difference that already causes different
behaviour! When using a ScrollView, even with fixed height of the very
outer LinearLayout, everything works as I wanted and the window does
not get resized / the layout does not get moved up by the
softkeyboard.
(Also setting android:layout_height="wrap_content" or
android:isScrollContainer="true|false" for the ListView doesn't make
any difference either.)


@Kenny: I'm aware of that attribute, but it doesn't make any
difference. I've also tried to explicitly set the property to
adjustPan and also to adjustResize to see if there's any difference,
but there's none at all.

 <activity android:name=".activity.directory.Category"
android:label="Category"
          android:windowSoftInputMode="adjustPan"
          android:screenOrientation="portrait">
    ....


> Don't know what all is going on there.  You could try using hierarchyviewer
> to see what is going on with your view hierarchy.  One possibility is that
> you haven't explicitly set resize or pan mode, so the framework is trying to
> infer this for you, and when the list view is invisible it considers it not
> to be there and thus there not being any resizable parts of the window,
> causing it to fall back to pan mode.

If I don't define android:windowSoftInputMode, the default should be
adjustUnspecified. And the behaviour for my two activities should be
the same, since both are containing a view that can scroll
content(ListView, ScrollView).

In the docs for android:windowSoftInputMode="adjustUnspecified" it
says:
  "The system will automatically select one of these modes depending
on whether the content of the window has any layout views that can
scroll their contents."

> causing it to fall back to pan mode.

Pan mode is what I want, if I understand correctly that this is the
mode where the softkeyboard just shows on top of the existing layout
without moving it up. (not sure what 'get panned' mean in the Android
docs, I'm not native).

But as said, I've also tried to explicitly set the
android:windowSoftInputMode attribute, and it doesn't make any
difference.

Regards,
Mathias


-- 
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