I have a very strange problem - I defined custom progress for the progress bar and
sometimes it shows, and sometimes not.
I tried to clean my project, restart eclipse and even restart the computer.
still happening.
here is the progress xml can do:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="5dp" /> <gradient android:startColor="#6f7754" android:endColor="#858762" android:angle="90"/> </shape> </item> <item android:id="@android:id/secondaryProgress"> <clip> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="5dp" /> <gradient android:startColor="#ffba00" android:endColor="#af6c03" android:angle="90"/> </shape> </clip> </item> <item android:id="@android:id/progress"> <clip> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <corners android:radius="5dp" /> <gradient android:startColor="#ffba00" android:endColor="#af6c03" android:angle="90" /> </shape> </clip>
and here is the xml where I use it:
<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_marginBottom="2dp" android:background="@drawable/quick_action_item_btn"> <ImageView android:id="@+id/icon" android:layout_width="21dp" android:layout_height="21dp" android:scaleType="centerInside"/> <ProgressBar android:id="@+id/progress" android:layout_width="20dp" android:layout_height="4dp" android:layout_marginTop="2dp" style="@android:style/Widget.ProgressBar.Horizontal" android:progressDrawable="@drawable/achievement_progress_bar"/> </LinearLayout>
piojo source share