Note that there are some explanatory texts on larger screens.

plurals
  1. POAndroid action bar tab bar divider
    text
    copied!<p>I am having problem setting the drawable for the divider. My style.xml looks like this:</p> <pre><code>&lt;resources xmlns:android="http://schemas.android.com/apk/res/android"&gt; &lt;style name="HCLTheme" parent="android:Theme.Holo.Light"&gt; &lt;item name="android:actionBarStyle"&gt;@style/HCLActionBarStyle&lt;/item&gt; &lt;item name="actionBarStyle"&gt;@style/HCLActionBarStyle&lt;/item&gt; &lt;item name="android:actionBarTabBarStyle"&gt;@style/HCLActionBarTabBarStyle&lt;/item&gt; &lt;item name="android:actionBarTabStyle"&gt;@style/HCLActionBarTabStyle&lt;/item&gt; &lt;/style&gt; &lt;style name="HCLActionBarStyle" parent="android:style/Widget.Holo.ActionBar"&gt; &lt;item name="android:background"&gt;@drawable/hcl_actionbar_drawable&lt;/item&gt; &lt;item name="background"&gt;@drawable/hcl_actionbar_drawable&lt;/item&gt; &lt;item name="android:titleTextStyle"&gt;@style/HCLActionBarTitle&lt;/item&gt; &lt;/style&gt; &lt;style name="HCLActionBarTabBarStyle" parent="@android:style/Widget.Holo.ActionBar.TabBar"&gt; &lt;item name="android:showDividers"&gt;middle&lt;/item&gt; &lt;item name="android:divider"&gt;@drawable/divider&lt;/item&gt; &lt;item name="android:dividerPadding"&gt;0dp&lt;/item&gt; &lt;/style&gt; &lt;style name="HCLActionBarTabStyle" parent="@android:style/Widget.Holo.ActionBar.TabView"&gt; &lt;item name="android:background"&gt;@drawable/action_bar_tab_style&lt;/item&gt; &lt;/style&gt; &lt;style name="HCLActionBarTitle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title"&gt; &lt;item name="android:textColor"&gt;@android:color/white&lt;/item&gt; &lt;/style&gt; &lt;/resources&gt; </code></pre> <p>In the HCLActionBarTabBarStyle I'm setting the @drawable/divider as the tab divider. This drawable is a 9patch image, a vertical black line.</p> <p>Before i set the divider drawable in the xml I'm getting the normal white divider like this:</p> <p><img src="https://i.stack.imgur.com/tI9c7.png" alt="https://dl.dropbox.com/u/93667096/a.png"></p> <p>After i set the drawable in the styles.xml i get this:</p> <p><img src="https://i.stack.imgur.com/LXhW7.png" alt="https://dl.dropbox.com/u/93667096/b.png"></p> <p>So as you can see the divider just gets wider, and its not the black vertical line from the 9patch image. I'm not even sure what the drawable for the divider has to be? A picture or layer list, or can it be a color? In fact i tried all of these 3 but with no success.</p>
 

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