Essayez ceci. ainsi, pour le côté gauche premier: -
<item android:state_selected="true">
<shape android:shape="rectangle">
<corners
android:topLeftRadius="5dp"
android:bottomLeftRadius="5dp"/>
<gradient
android:startColor="#880f0f10"
android:endColor="#000"
android:gradientRadius="400"
android:angle="-270"/>
<stroke android:width="3px" android:color="@color/black" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="#CCCCCC"
android:centerColor="#CCCCCC"
android:endColor="#CCCCCC"/>
<corners
android:topLeftRadius="5dp"
android:bottomLeftRadius="5dp"/>
<stroke android:width="5px" android:color="@color/black" />
</shape>
</item>
côté droit dernier: -
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true">
<shape android:shape="rectangle">
<corners
android:topRightRadius="5dp"
android:bottomRightRadius="5dp"/>
<gradient
android:startColor="#880f0f10"
android:endColor="#000"
android:gradientRadius="400"
android:angle="-270"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="#CCCCCC"
android:centerColor="#CCCCCC"
android:endColor="#CCCCCC"/>
<corners
android:topRightRadius="5dp"
android:bottomRightRadius="5dp"/>
<stroke android:width="5px" android:color="@color/black" />
</shape>
</item></selector>
pour le centre
<?xml version="1.0" encoding="utf-8"?>
<selector
xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true">
<shape android:shape="rectangle">
<gradient
android:startColor="#880f0f10"
android:endColor="#000"
android:gradientRadius="400"
android:angle="-270"/>
</shape>
</item>
<item>
<shape android:shape="rectangle">
<gradient
android:angle="90"
android:startColor="#CCCCCC"
android:centerColor="#CCCCCC"
android:endColor="#CCCCCC"/>
<stroke android:width="5px" android:color="@color/black" />
</shape>
</item></selector>
et en Java
mTabHost.getTabWidget().getChildAt(0).setBackgroundResource(R.drawable.roundcorner_tab_left);
mTabHost.getTabWidget().getChildAt(1).setBackgroundResource(R.drawable.roundcorner_tab_center);
mTabHost.getTabWidget().getChildAt(2).setBackgroundResource(R.drawable.roundcorner_tab_right);
quel est votre problème? –
quel est le problème ?? –
J'ai besoin de sortie en tant que première image. –