2

I want to set an background to my listview that have different size (depending the appearance of softkeyboard). My list view is in between the editboxes and I want my editboxes always to be visible (means I do not want to use adjustPan).

My problem comes in the moment when the android adjust the size of my listview and the background get tweaked. I want my background to remain the same, just to be cropped.

enter image description here enter image description here

and I want to look something like this enter image description here Is there any style that I can add that will make the image act like this, the point is to do NOT do an resize and to fill the whole available area. And to DO something like a CROP , means to show as much as there is an space and then the rest just to be cropped.

Lukap
  • 31,523
  • 64
  • 157
  • 244

3 Answers3

2

I found some workaround for the problem I want to solve. I set the scaleType with "centerCrop" value and it seems to work fine.

I hope this will save time to someone else having this problem...

Lukap
  • 31,523
  • 64
  • 157
  • 244
1

Try in your Manifest to add

android:windowSoftInputMode="adjustPan" or "adjustUnspecified"

for your <activity

Read more about values here: http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

Nikola Despotoski
  • 49,966
  • 15
  • 119
  • 148
0

I would put the listview in a linearlayout and put the background on the linearlayout.

As for the textbox at the top, if you have not figured that out, use relativelayout.

Here is a good link about the view being re-sized by the keyboard: http://groups.google.com/group/android-developers/browse_thread/thread/be5ffe40c2bc29f0?pli=1

Here is a good link for the button staying on top: Add Image at above of listview

Community
  • 1
  • 1
Anthony Graglia
  • 5,355
  • 5
  • 46
  • 75
  • "I would put the listview in a linearlayout and put the background on the linearlayout." this will not help, cause when the soft keyboard is shown the layout will be re-sized so the effect will be the same – Lukap Oct 28 '11 at 09:36
  • relative layout is interesting idea but I still do not get how can I do this, can you provide a xml layout ?, and this is workaround of the problem, my prime question was is there any thing that I can to manipulate the background itself someting like scaling (FIT_XY)...or something like that – Lukap Oct 28 '11 at 09:40
  • I added another link to the answer... Check it out for the resize problem. As for the XML, check the other link in the answer which has an example. Hope it helps. – Anthony Graglia Oct 28 '11 at 11:12