xml でドローアブルを定義しました。
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<padding
android:bottom="1dp"
android:left="0dp"
android:right="0dp"
android:top="5dp" />
<corners
android:bottomLeftRadius="0.1dp"
android:bottomRightRadius="0.1dp"
android:topLeftRadius="15dp"
android:topRightRadius="15dp" />
</shape>
そしてそれをレイアウトxmlで使用します:
<RelativeLayout
style="@style/TabHeader"
android:background="@drawable/_moremsg_tab_back" >
<TextView
android:id="@+id/text"
style="@style/TabText"
android:text="TODO" />
</RelativeLayout>
効果は次のとおりです (最初のタブ):
他のタブをクリックすると、コードでドローアブルを背景として追加します。
v.setBackgroundDrawable(getResources().getDrawable(R.drawable._moremsg_tab_back));
ただし、最初のものとは異なります。
修正方法は?