How can I hide views when the soft keyboard is up?

437 views
Skip to first unread message

newobj

unread,
Nov 1, 2010, 4:43:18 PM11/1/10
to Android Developers
I have a pretty standard search edit widget on top / search results
list widget on bottom activity in my app. Below the results list
widget I also have my view for ads. When the soft keyboard is brought
up in this activity, I'd like to hide the view the ads are in because
they consume too much screen space. I tried making that view
android:isScrollContainer="true" but that had no effect.

So the question is, how can I ensure that certain views will be hidden
when the soft keyboard is brought up?

paulb

unread,
Nov 4, 2010, 9:00:39 AM11/4/10
to android-d...@googlegroups.com
Hello,

Maybe you want to add the attribute:

android:windowSoftInputMode="adjustPan"

to your activity in the AndroidManifest

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

newobj

unread,
Nov 4, 2010, 3:25:53 PM11/4/10
to Android Developers
It's not really what I want. I want an adjustResize behavior, however,
I also want to completely hide certain views. It's really a more
specific version of the question "how do I do things when the keyboard
appears/disappears" - a question to which I've never found a
satisfactory answer that works across all the phones I test on. Do you
know of an answer to that question?

Thanks,
Brian
Reply all
Reply to author
Forward
0 new messages