我在我的繪製目錄中名爲off.xml的XML文件(是應該是一個紅色圓圈)...使用XML文件作爲繪製資源
<?xml version="1.0" encoding="UTF-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval" >
<gradient android:startColor="#FFFF0000" android:endColor="#FFFF0000"
android:angle="270"/>
在我的主頁我有以下XML ...
<LinearLayout android:layout_width="match_parent"
android:layout_height="50dip" android:orientation="horizontal">
<View android:layout_width="40dip"
android:layout_height="0dip" android:layout_weight="1"
android:background="@drawable/off" />
</LinearLayout>
我得到的錯誤「無法轉換@繪製/斷成繪製。紅圈不顯示。 (我已經把一個按鈕那裏,以確保其他婦女參與發展得到會顯示)
什麼是導致此錯誤。我從本論壇的另一篇文章中得到了應該工作的例子。 感謝,加里
我不錯過標籤。這個論壇有些錯誤,有時無法識別粘貼的線條。你的回答讓我想到了身高和體重,結果我必須將layout_weight放在linearlayout而不是視圖上。我仍然在Eclipse中看到錯誤,但紅圈顯示。 –