Is it possible to change the look of my Fragment Tab Host into something like this?
Asked
Active
Viewed 643 times
1 Answers
0
You can simply do that by making an custom drawable for the indicator of each tab containing two images one for selected state and another without selected state and then just set that drawable as an indicator for each tab while adding tabs to the TabHost. For eg..
YourTabHost.addTab(newTabSpec(tabname).setIndicator("",
getResources().getDrawable(R.drawable.yourcustomdrawable)));
and your custom drawable will look like this..
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/selectedbuttonimage" android:state_selected="true"/>
<item android:drawable="@drawable/normalimage"/>
</selector>

Mukesh Rana
- 4,051
- 3
- 27
- 39
-
Can you help me make one? I'm not good in that and my knowledge in android is not that broad sorry :( – user3062224 Sep 27 '14 at 06:49
-
Thanks for that. But is there any other way rather than configuring drawables? I've read about tabstrips but I was not able to get the exact information I needed. My idea is whenever a specific tab is highlighted, for example tab1 is chosen, there should be borderlines around that tab and vice versa – user3062224 Sep 27 '14 at 07:23