Frage

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?

War es hilfreich?

Lösung

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

Andere Tipps

For the quick solution I recommend you to use a small Android library SmoothProgressBar allowing you to have a smooth and customizable horizontal indeterminate ProgressBar.

enter image description here

Credits: Johnkil

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top