0
我在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));
但它顯示爲第一個不同:
如何解決呢?
我瘋了,用這些Android的bug。每天我都可以遇見一個:( – Freewind