tags:

views:

13

answers:

1

Hi

I'm using xml file to define progress bar. I defined padding on background shape. But this setting will be sometimes displayed correctly, sometimes not. So If I start my application or Activity with progressbar inside, there will be correctly displayed progressbar with background and 'padded' progress. Then I close my application and start it again, and, progressbar is displayed without padded background, on next start will be displayed correctly and son on ... Could you please advice possible reasons for this?

xml file:

<item android:id="@android:id/background" >
    <shape>
        <corners android:radius="15dip" />
        <padding
                android:left="1dp"
                android:top="6dp"
                android:right="1dp"
                android:bottom="6dp" 
        />
        <solid
                android:color="#00000000" />
    </shape>
</item>

<item android:id="@android:id/progress" >
    <clip android:clipOrientation="horizontal" android:gravity="left" >
        <shape
            xmlns:android="http://schemas.android.com/apk/res/android"
            android:shape="rectangle">
            <corners android:radius="15dip" />
            <stroke 
            android:width="1px" 
            android:color="#ffffffff" 
            android:dashWidth="2px" 
            android:dashGap="0px"/>
            <solid
                android:color="#ff0000ff" />
        </shape>
    </clip>
</item> 

A: 

Problem solved !

I've removed both android:id attributes and now is it working properly !

Richard