0

An EditText at the bottom of a ListView when pressed, hides the ActionBar. My first problem was to prevent the background image of ListView to shrink. Somehow i overcame my issue. But dnt know how to tackle this one. Can any body guide me? Thanx in advance.

Edit(Explanation)

like a chat window in Viber or Whats App, i have a EditText at the bottom, a ListView in the center and an ActionBar at the top. when i clicked the EditText , the background image shrinks/squeeze. I used adjustPan to overcome this. Its fine. But now, when the soft Keyboard appears, it hides the ActionBar/TitleBar.

Ali Ansari
  • 219
  • 3
  • 14

1 Answers1

2

Use adjustResize instead of adjustPan. The framework will always try to keep the focused element on-screen by scrolling any parent views if necessary.

If your EditText field is not nested in some sort of scrolling container such as a ScrollView then your layout may be too tall to completely display when the keyboard resizes your activity. Try wrapping your form's layout in a ScrollView. This will also allow your app's content to scroll if it is running on a smaller screen device where it may have similar issues.

Android Priya
  • 686
  • 1
  • 6
  • 23
  • When i use `adjustResize` it shrinks the background image. – Ali Ansari Jun 17 '14 at 11:52
  • my previous problem was like : http://stackoverflow.com/questions/4287473/android-soft-keyboard-resizes-background-image – Ali Ansari Jun 17 '14 at 12:01
  • In Manifest android:windowSoftInputMode="adjustResize|stateAlwaysHidden" In XMl Dont Set any background here.And keep your view under ScrollView In Java You need to set the background to window: getWindow().setBackgroundDrawableResource(R.drawable.bg_wood) ; – Android Priya Jun 17 '14 at 12:05
  • You can also try android:scaleType="matrix" in your background imageview – Android Priya Jun 17 '14 at 12:08