title: Android change height of selected tab in tabwidget
body: <p>I want to change the height of the selected tab within the <code>tabwidget</code> as shown in the image below.</p>
  
  <p>I used approach: I used two images  first image have transparent part on top of that and second is full image,on tab selected i changed first image with second one. but this approach doesn't work in all device. We have to create images with equal height and also convert to nine patch of each.</p>
  
  <p>the figure is shown what i exactly needed.<img src="https://i.stack.imgur.com/6B7k7.png" alt="enter image description here"></p>
  
  <pre><code>TabHost.TabSpec spec    =   mTabHost.newTabSpec(AppConstants.TAB_A);
  
      spec.setContent(new TabHost.TabContentFactory() {
          public View createTabContent(String tag) {
              return findViewById(R.id.realtabcontent);
          }
      });
       spec.setIndicator(createTabView(R.drawable.hometabselection));//style applied here on each tab
       mTabHost.addTab(spec);
  
      spec                    =   mTabHost.newTabSpec(AppConstants.TAB_B);
      spec.setContent(new TabHost.TabContentFactory() {
          public View createTabContent(String tag) {
              return findViewById(R.id.realtabcontent);
          }
      });
      spec.setIndicator(createTabView(R.drawable.realtabselection));
      mTabHost.addTab(spec);
      spec       =   mTabHost.newTabSpec(AppConstants.TAB_C);
      spec.setContent(new TabHost.TabContentFactory() {
          public View createTabContent(String tag) {
              return findViewById(R.id.realtabcontent);
          }
      });
  
      spec.setIndicator(createTabView(R.drawable.topnewwsselection));
  
      mTabHost.addTab(spec);
  
      spec                    =   mTabHost.newTabSpec(AppConstants.TAB_D);
      spec.setContent(new TabHost.TabContentFactory() {
          public View createTabContent(String tag) {
              return findViewById(R.id.realtabcontent);
          }
      });
  
      spec.setIndicator(createTabView(R.drawable.treadingselection));
  
      mTabHost.addTab(spec);
  </code></pre>
  
  <p><strong>hometabselection.xml</strong> //in drawable which is used for all different tab selection</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;selector xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  &lt;item
      android:state_selected="true"
      android:drawable="@drawable/homeselected" /&gt;//full image
  &lt;item
     android:state_selected="false"
     android:drawable="@drawable/homenormal" /&gt;//image with some portion transparent on top of that
  &lt;/selector&gt;
  </code></pre>
  
  <p><strong>layout</strong></p>
  
  <pre><code> &lt;TabHost
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@android:id/tabhost"
        android:layout_width="fill_parent"
         android:layout_height="fill_parent" &gt;
      &lt;LinearLayout
             android:layout_width="fill_parent"
             android:layout_height="fill_parent"
             android:orientation="vertical" &gt;
            &lt;FrameLayout
              android:id="@android:id/tabcontent"
              android:layout_width="@dimen/fr_layout_width"
              android:layout_height="@dimen/fr_layout_height"
              android:layout_weight="0" /&gt;
          &lt;FrameLayout
              android:id="@+android:id/realtabcontent"
              android:layout_width="fill_parent"
              android:layout_height="@dimen/fr_layout_height"
              android:layout_weight="1" /&gt;
  
          &lt;TabWidget
              android:id="@android:id/tabs"
              android:layout_width="fill_parent"
              android:layout_height="@dimen/hdpi_tab_layout_height"
              android:layout_weight="0"
              android:divider="@drawable/tab_bg"
              android:background="@android:color/transparent"
              android:dividerPadding="@dimen/tab_divider_padding"
              android:orientation="horizontal" /&gt;
      &lt;/LinearLayout&gt;
  &lt;/TabHost&gt;
  </code></pre>