0

I want to create a custom ProgressBar. I've created a style like this:

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android" >

<item android:id="@android:id/background"
   android:drawable="@drawable/loading_empty">       
</item>


<item android:id="@android:id/progress">
    <clip>
        <shape>
            <gradient
                android:startColor="#007A00"
                android:centerColor="#007A00"
                android:centerY="1.0"
                android:endColor="#06101d"
                android:angle="270"
            />
        </shape>
    </clip>
</item>

</layer-list>

My ProgressBar background is "@drawable/loading_empty". This works fine. Right know my bar is green. (see the second item). I have a second drawable, how the bar should look like. How can I implement this? If I try to do it like the first item the whole ProgressBar is filled with my second drawable.

Billabong
  • 457
  • 2
  • 8
  • 23
  • 1
    Would this help? http://stackoverflow.com/questions/9921621/android-progressbar-ui-custom-layout – gunar Jul 17 '13 at 12:37
  • mh I wonder why I didn't find this thread. thank you it works – Billabong Jul 17 '13 at 13:16
  • possible duplicate of [Custom Drawable for ProgressBar/ProgressDialog](http://stackoverflow.com/questions/2819778/custom-drawable-for-progressbar-progressdialog) – Cimbali Sep 27 '15 at 16:41

0 Answers0