Android scaling image vertically
<p>I am trying to create a mini progress bar that will indicate how much data a user has used. It doesn't even need to animate, I just need it to change in size based on a variable I have set up. So when I load up the screen, how much of the progress bar is filled up will depend on a variable I have set up in Java.</p>

<p>I have managed to get this working horizontally by using</p>

<pre><code>scale =  new ScaleAnimation(0.0f, 1.5f, 1.0f, 1.0f,1.0f, 1.0f);
</code></pre>

<p>This will start the image from nothing and stretching out to its full size, so I can use it as a horizontal progress bar which is great. </p>

<p>Now I woulda thought doing this vertically instead would be a simple matter of just changing the fromY to 0 and the toY to the new size I want. However when I do this, by changing the fromY to 0.0f and the toY to 2.0f, the image actually moves and stretches at the same time rather than stretching. Also the image moves position for some reason. It starts off higher up than where I positioned in using XML, and moves down to the original position and stretches out to the new scale I set up.</p>

<p>The code I use to try and stretch it vertically is</p>

<pre><code>scale =  new ScaleAnimation(1.0f, 1.0f, 0.0f, 2.0f, 1.0f, 1.0f);
</code></pre>

<p>So can someone please explain why it stretches horizontally fine, but when I try to stretch it vertically, it suddenly moves and stretchs at the same time.</p>

<p>Would be very grateful for any help.</p>
