2013-07-23 120 views
1
<shape xmlns:android="http://schemas.android.com/apk/res/android"> 
    <solid android:color="#F0A0A0A0"/> 
    **<stroke android:width="2dp" color="#A00080FF"/>** 
    <padding android:left="5dp" android:top="0dp" 
     android:right="5dp" android:bottom="1dp" /> 
</shape> 

我在粗線上得到上述錯誤。 「屬性丟失了Android命名空間前綴」屬性缺少Android名稱空間前綴

回答

5

<stroke android:width="2dp" color="#A00080FF"/> 

應該是

<stroke android:width="2dp" android:color="#A00080FF"/> 
1

採用Android:顏色= 「#A00080FF」

,而非彩色= 「#A00080FF」

樣品::

<?xml version="1.0" encoding="UTF-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle"> 
    <stroke android:width="2dp" android:color="#FFFFFFFF" /> 
    <gradient android:startColor="#DD000000" android:endColor="#DD2ECCFA" 
      android:angle="225"/> 

    <corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" 
    android:topLeftRadius="7dp" android:topRightRadius="7dp"/> 
</shape> 
相關問題