Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thick orange ProgressBar instead of thin blue one

I am having a ProgressBar widget in my app and no matter what I do, it always shows as a fat orange one (2.x style) instead of thin blue (4.x style).

  • Project build target is set to Google API 4.0.3 (API Level 15)
  • SDK version requirements are set as follows:

    <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="14"/>
    
  • Application theme is set to Theme.Holo

  • The app is run on several devices and emulators (all running KitKat or other ICS-based versions)
  • The progress bar itself is defined as follows:

       <ProgressBar
            android:id="@+id/progressBar1"
            style="@android:style/Widget.ProgressBar.Horizontal"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentLeft="true"
            android:layout_alignParentTop="true"
            android:layout_marginRight="16dp"
            android:layout_marginLeft="16dp"
            android:theme="@android:style/Theme.Holo" />  
    

(explicitly set theme is the latest attempt to turn it to the new style).

Is there anything I am missing?

like image 966
Alexander L. Belikoff Avatar asked Jan 23 '14 03:01

Alexander L. Belikoff


1 Answers

What you need is style="@android:style/Widget.Holo.ProgressBar.Horizontal", not style="@android:style/Widget.ProgressBar.Horizontal.

And, android:theme should be set in <Activity> tag, not in a specific view.

Hope it helps

like image 191
Zhenghong Wang Avatar answered Oct 21 '22 22:10

Zhenghong Wang