Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I can't comment on your answer but I'd like to add something.</p> <p>I understand your dilemma and why the solution you linked to isn't a complete solution for your situation (since you can't scroll to the bottom of the view). I have a similar situation with a large scrollable EditText box. When the soft keyboard pops up I don't like my background getting squished.</p> <p>I have tried your solution and while at first glance it appears to work, there are some situations where it might not be ideal:</p> <ol> <li>If you allow your app the have a landscape mode, the background will not resize/stretch</li> <li>If you run your app on a device with a larger screen or dpi, your background may not fill the screen</li> </ol> <p>Basically it seems that when you set the <code>scaleType</code> to <code>matrix</code> you're telling Android to draw the background 1:1 and not to scale. So what's happening when you open the soft keyboard using your solution is, your <code>scrollView</code> and <code>imageView</code> are all getting resized as usual, but the image src you set remains 1:1 thus continues showing the same area.</p> <p>So if for example your background image was set to a specific size (e.g. 480 x 800) and it perfectly fills your Nexus One, the moment you rotate to landscape you will have a black area along the right.</p> <p>This is moot, of course, if your background is simply a repeating pattern, in which case you can make it extremely large and hopefully compensate for various screens (maybe even tablets).</p> <p>Or you can also supply different backgrounds for different screen sizes/densities/orientations, but this still doesn't account for scaling.</p> <p>In a vain effort to try and solve this, I stumbled upon a <code>View</code> attribute called <a href="http://developer.android.com/reference/android/view/View.html#attr_android%3aisScrollContainer"><code>android:isScrollContainer</code></a>. This attribute tells certain views whether or not they are allowed to resize upon display of the soft keyboard. This is also mentioned by someone in your linked solution. I have tried setting this (to false) on the <code>ViewGroup</code> containing my background, but any child element that scrolls seems override it causing the squishing again.</p> <p>As of right now I don't think there is a complete solution for our situation. Your's definitely works in some instances and I thank you for the effort. Hopefully Google will offer a solution in the future, but I don't think they would consider this a problem/priority.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload