2013-10-07 100 views
1

我想設置爲線性佈局設置邊框顏色白色,但沒有內部顏色。如何設置線性佈局的邊框顏色

這是我的代碼,顯示內部顏色黑色。錯誤在哪裏?

<?xml version="1.0" encoding="utf-8"?> 
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"> 
    <item android:left="0dp" android:right="0dp" android:top="-10dp" android:bottom="-10dp"> 
     <shape android:shape="rectangle"> 
      <stroke android:width="1dp" android:color="#ffffff" /> 
     </shape> 
    </item> 
</layer-list> 

回答

3

<solid android:color="@android:color/transparent" />添加到形狀標籤中。

<shape android:shape="rectangle" > 

    <solid android:color="@android:color/transparent" /> 
</shape> 
+0

謝謝你,它的工作... – chimbu

+0

你最歡迎... –

0
android:color="#ffffff" 

應該是:

android:color="#000000" 

當前顏色代碼被設置爲白色,而不是黑色的。

0

該設置,您的LinearLayout背景

<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" > 

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

    <solid android:color="#000000" /> 
</shape> 
0
<?xml version="1.0" encoding="utf-8"?> 
<shape xmlns:android="http://schemas.android.com/apk/res/android" 
    android:shape="rectangle" 
    > 
    <solid android:color="color_that_u_want_in background" /> 
    <stroke android:width="1dp" 
     android:color="#ffffff"/> 

</shape> 

使用本

相關問題