2013-07-19 40 views
0

我有這個問題,我一直試圖刪除一段時間,現在我想這是不可能的,但無論如何這裏是我的問題。我或者需要在listview改變顏色的邊框或者刪除邊框以允許背景顏色顯示。從列表中刪除邊框

enter image description here

在這裏你可以看到灰色的分隔,但我需要的白色邊框繞來繞去刪除畫面的邊緣或顏色變成灰色分頻器是#e5e5e5的顏色。邊框的東西看起來很像一個framelayout或margin,但是我找不到任何代碼來使它實際上創建一個邊框。然後,我可以爲列表視圖做一個正確的邊距,顏色應該都看起來正確和體面。感謝您的幫助,並要求提供可能需要的任何代碼。

main.xml中

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:orientation="vertical" 
android:background="#e5e5e5" > 

<ListView 
    android:id="@+id/list" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:divider="#e5e5e5" 
    android:dividerHeight="6dp" 
    android:background="@drawable/background_card"/> 

</LinearLayout> 

ListView.xml

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:background="@drawable/background_card" 
android:orientation="horizontal" 
android:padding="5dip" > 

<!-- ListRow Left sied Thumbnail image --> 
<LinearLayout android:id="@+id/thumbnail" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:padding="3dip"  
    android:layout_alignParentLeft="true" 
    android:background="@drawable/image_bg" 
    android:layout_marginRight="5dip"> 

    <ImageView  
     android:id="@+id/list_image" 
     android:layout_width="50dip" 
     android:layout_height="50dip" 
     android:src="@drawable/rihanna"/> 

</LinearLayout> 

<!-- Title Of Song--> 
<TextView 
    android:id="@+id/title" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignTop="@+id/thumbnail" 
    android:layout_toRightOf="@+id/thumbnail" 
    android:text="Rihanna Love the way lie" 
    android:textColor="#040404" 
    android:typeface="sans" 
    android:textSize="15dip" 
    android:textStyle="bold"/> 

<!-- Artist Name --> 
<TextView 
    android:id="@+id/artist" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/title" 
    android:textColor="#343434" 
    android:textSize="10dip" 
    android:layout_marginTop="1dip" 
    android:layout_toRightOf="@+id/thumbnail" 
    android:text="Just gona stand there and ..." /> 

<!-- Rightend Duration --> 
<TextView 
    android:id="@+id/duration" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_alignParentRight="true" 
    android:layout_alignTop="@id/title" 
    android:gravity="right" 
    android:text="5:45" 
    android:layout_marginRight="5dip" 
    android:textSize="10dip" 
    android:textColor="#10bcc9" 
    android:textStyle="bold"/> 

<!-- Rightend Arrow -->  
<ImageView android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:src="@drawable/arrow" 
    android:layout_alignParentRight="true" 
    android:layout_centerVertical="true"/> 

</RelativeLayout> 
+0

你可以發佈你的XML代碼 –

+0

@GokhanArik補充說,它使用 – ThePoloDoc

+0

現在打開GPU透支,看綠色和紅色色調出現兩個XML文件。您應該考慮優化背景以減少透支。從它的外觀來看,合適的窗口背景和列表項背景應該足以獲得相同的效果。 –

回答

0

在你Main.xml,添加android:layout_marginLeft="6dp"android:layout_marginRight="6dp"ListView。這會給你的ListView兩側的灰色邊框:

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="vertical" 
    android:background="#e5e5e5" > 

    <ListView 
     android:id="@+id/list" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:layout_marginLeft="6dp" 
     android:layout_marginRight="6dp" 
     android:divider="#e5e5e5" 
     android:dividerHeight="6dp" 
     android:background="@drawable/background_card"/> 

</LinearLayout> 
+0

謝謝,完美無缺 – ThePoloDoc