title: How to change the style of tabs on android 2.3- actionbarsherlock
body: <p>Hi I want to change the tabs in android &lt;=2.3 because they take too much space </p>
  
  <p><img src="https://i.stack.imgur.com/93oqq.png" alt="enter image description here"> </p>
  
  <p>to </p>
  
  <p><img src="https://i.stack.imgur.com/X18lg.png" alt="enter image description here"></p>
  
  <p>And I also want to modify it's background and icons.</p>
  
  <p>I am using <code>actiobarsherlock</code> library. </p>
  
  <p>Here is what I tried</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;TabHost xmlns:android="http://schemas.android.com/apk/res/android"
      android:id="@android:id/tabhost"
      android:layout_width="match_parent"
      android:layout_height="match_parent" &gt;
  
      &lt;LinearLayout
          android:layout_width="match_parent"
          android:layout_height="match_parent"
          android:orientation="vertical" &gt;
  
          &lt;TabWidget
              android:id="@android:id/tabs"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_marginTop="?attr/actionBarSize"
              android:layout_weight="0"
              style="@style/ActionBarTabStyle.Example"
              android:orientation="horizontal"
              android:tabStripEnabled="false" /&gt;
  
          &lt;FrameLayout
              android:id="@android:id/tabcontent"
              android:layout_width="0dp"
              android:layout_height="0dp"
              android:layout_weight="0" /&gt;
  
          &lt;com.mainapp.CustomViewPager
              android:id="@+id/pager"
              android:layout_width="match_parent"
              android:layout_height="0dp"
              android:layout_weight="1" /&gt;
      &lt;/LinearLayout&gt;
  
  &lt;/TabHost&gt;
  </code></pre>
  
  <p>Style</p>
  
  <pre><code>&lt;style name="ActionBarTabStyle.Example" parent="@style/Widget.Sherlock.Light.ActionBar.TabView"&gt;
          &lt;item name="android:background"&gt;@drawable/tab_indicator_ab_example&lt;/item&gt;
      &lt;/style&gt;
  </code></pre>
  
  <p>-
      
          
          
          </p>
  
  <pre><code>    &lt;!-- Focused states --&gt;
      &lt;item android:state_focused="true" android:state_selected="false" android:state_pressed="false" android:drawable="@drawable/tab_unselected_focused_example" /&gt;
      &lt;item android:state_focused="true" android:state_selected="true"  android:state_pressed="false" android:drawable="@drawable/tab_selected_focused_example" /&gt;
  
      &lt;!-- Pressed --&gt;
      &lt;!--    Non focused states --&gt;
      &lt;item android:state_focused="false" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/tab_unselected_pressed_example" /&gt;
      &lt;item android:state_focused="false" android:state_selected="true"  android:state_pressed="true" android:drawable="@drawable/tab_selected_pressed_example" /&gt;
  
      &lt;!--    Focused states --&gt;
      &lt;item android:state_focused="true" android:state_selected="false" android:state_pressed="true" android:drawable="@drawable/tab_unselected_pressed_example" /&gt;
      &lt;item android:state_focused="true" android:state_selected="true"  android:state_pressed="true" android:drawable="@drawable/tab_selected_pressed_example" /&gt;
  &lt;/selector&gt;
  </code></pre>
  
  <p>Thanks! </p>