Custom undefined progress bar

I have successfully implemented this progress enter image description here

Using an animation list with resources like this: enter image description hereenter image description hereenter image description here

But the problem is that I cannot make semi-high progress with these resources.

I tried half-height resources with gravity centered vertically like this: enter image description hereenter image description hereenter image description here

But the result was enter image description here

Android has moved this move to the bottom. Any ideas how I can focus my half-forgotten progress? thanks in advance.

@Antoine Marques I tried using nine patches but I get something like this enter image description here

And here is my animation list:

<item android:duration="200" android:drawable="@drawable/progressbar_indeterminate1_0" />

      

And a resource example: enter image description here

+3


source to share


1 answer


The solution to your problem is that your custom progress can be done internally ScaleDrawable

:



<scale xmlns:android="http://schemas.android.com/apk/res/android"
    android:drawable="@drawable/my_custom_progress"
    android:scaleGravity="center_vertical|center_horizontal"
    android:scaleHeight="100%"
    android:scaleWidth="100%" />

      

+1


source







All Articles