I'm trying to create a tab-bar like the one shown in the image below ( i.e. a tab-bar with some images on the left ) .
The white part are two images while the black part are the tab-labels
Can anyone guide me in doing the same ?
I'm trying to create a tab-bar like the one shown in the image below ( i.e. a tab-bar with some images on the left ) .
The white part are two images while the black part are the tab-labels
Can anyone guide me in doing the same ?
Using actionBar.addTab(actionBar.newTab()
//.setText(mSectionsPagerAdapter.getPageTitle(i))
.setCustomView(view)
.setTabListener(this));
Here, you customize your layout and parse it into view
See [How to set a custom View in ActionBar's navigation tabs and make the tabs adapt to its height?
I managed to get a workaround without using action bar . Just some XML code tweaking , and I was good to go . Here's what I did :
<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">
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
>
<RelativeLayout
android:id="@+id/linear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="@drawable/tab_bg" >
<LinearLayout
android:orientation="horizontal"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/options"
android:layout_gravity="center"
android:layout_marginLeft="10dp"/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/img"
android:layout_marginLeft="10dp"/>
</LinearLayout>
<TabWidget
android:id="@android:id/tabs"
android:layout_width="300dp"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"/>
</RelativeLayout>
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignLeft="@+id/linear"
android:layout_below="@+id/linear">
</FrameLayout>
</RelativeLayout>
</TabHost>