Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to create a custom style for your <code>SeekBar</code> which has a different progress drawable.</p> <p>Copy the file android-sdk-root\platforms\android-8\data\res\drawable\progress_horizontal.xml into your drawable-folder. Alter the colors as you see fit.</p> <p>In your styles.xml, create a custom style which uses your custom background drawable:</p> <pre><code>&lt;style name="CustomSeekbarStyle" parent="@android:style/Widget.SeekBar"&gt; &lt;item name="android:progressDrawable"&gt;@drawable/custom_progress_horizontal&lt;/item&gt; &lt;/style&gt; </code></pre> <p>To use your custom style, either set it explicitly for every SeekBar in your application like this:</p> <pre><code>&lt;SeekBar android:layout_width="match_parent" style="@style/CustomSeekbarStyle" android:progress="50" android:layout_height="wrap_content" /&gt; </code></pre> <p>Or set the style globally in your application theme:</p> <pre><code>&lt;style name="AppBaseTheme" parent="android:Theme.Light"&gt; &lt;item name="android:seekBarStyle"&gt;@style/CustomSeekbarStyle&lt;/item&gt; &lt;/style&gt; </code></pre> <p>Edit 1: If your application uses newer themes on newer devices (i.e. holo-theme on ICS devices), you should consider overriding the progress_horizontal file for all relevant API levels. Create multiple drawable-vXX folders (i.e. drawable-v10 for GB, drawable-v14 for ICS) and put modified progress_horizontal.xml-files in those folders. You'll find those files in your android SDK as well.</p> <p>Edit 2: This solution however does not come without a somewhat serious flaw: Device vendors like to create custom themes for their android firmwares, often involving different drawables and colors. Using the approach described above, those custom styles are overridden, possibly resulting in an inconsistent user interface.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload