Hi All,
I was wondering... how can I change the tab colors when selected and when deselected. Here's a picture of how it looks now:
http:// i.imgur.com/FOT4Q.jpg
I would like my tabinterface will look like this:
http:// www.technobuzz.net/wp-content/uploads/2010/02/seesmic-android-260-208.png
So i can't change my colors of the tabs... I think this is a sense issue. I hope someone can try to help...all responses / solutions are welcomed. I've tried many options but no effect here is my source code:
Main.java
// Create a tab
intent = new Intent().setClass(this, Home.class);
spec = tabHost.newTabSpec("home").setIndicator("Home",
res.getDrawable(R.drawable.tab_home))
.setContent(intent);
tabHost.addTab(spec);
tab_home.xml
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- When selected, use grey -->
<item android:drawable="@drawable/artists_on"
android:background="@drawable/custom_tab"
/>
<!-- When not selected, use white-->
<item android:drawable="@drawable/artists_of" />
</selector>
custom_tab.xml
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true" >
<shape>
<gradient
android:startColor="#0000ff"
android:endColor="#000000"
android:angle="270" />
<stroke
android:width="3dp"
android:color="#2e2e2e" />
<corners
android:radius="3dp" />
</shape>
</item>
<item android:state_focused="true" >
<shape>
<gradient
android:endColor="#802222"
android:startColor="#B02222"
android:angle="270" />
<stroke
android:width="3dp"
android:color="#2e2e2e" />
<corners
android:radius="3dp" />
</shape>
</item>
<item>
<shape>
<gradient
android:startColor="#999999"
android:centerColor="#555555"
android:endColor="#999999"
android:height="1px"
android:angle="0" />
<stroke
android:width="3dp"
android:color="#2e2e2e" />
<corners
android:radius="3dp" />
</shape>
</item>
</selector>
Thanks!