2011-01-15 8 views
1

誰かがListViewで黒の行を取り除く方法を知っていますか?スクリーンショットを見てください。ListViewレイアウトで黒の行を取り除く方法

alt text

各行のためのXML:

<?xml version="1.0" encoding="utf-8"?> 

<LinearLayout 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@+id/list_view"> 

    <RelativeLayout 
     android:id="@+id/r_layout_for_tasks" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" 
     android:background="#ffffff"> 

     <ImageView 
      android:id="@+id/icon_image_view" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:src="@drawable/clock" 
      android:layout_alignParentLeft="true"> 
     </ImageView> 

     <TextView 
      android:id="@+id/task_text_view" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:paddingLeft="10dp" 
      android:layout_toRightOf="@id/icon_image_view"> 
     </TextView>  

     <TextView 
      android:id="@+id/time_text_view" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      android:layout_alignParentRight="true"> 
     </TextView> 

    </RelativeLayout> 
</LinearLayout> 

アクティビティのレイアウト:

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

    <RelativeLayout 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:padding="10dp" 
    android:background="#ffffff"> 

    <Button 
     android:id="@+id/ok_button" 
     android:onClick="onClickOKButton" 
     android:text="OK" 
     android:layout_width="wrap_content"   
     android:layout_height="wrap_content" 
     android:minWidth="60dp" 
     android:layout_alignParentRight="true"> 
    </Button> 

    <EditText 
     android:id="@+id/edit_text" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" 
     android:hint="Task description" 
     android:layout_toLeftOf="@id/ok_button"> 
    </EditText> 

    </RelativeLayout> 

<ListView 
    android:id="@+id/list_view"  
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:padding="10dp"> 
</ListView> 

</LinearLayout> 

答えて

3

は、XMLレイアウトに設定するandroid:divider属性を見てください。リストビューの背景と同じ色に設定することができます。

+3

「android:divider = "@ null"」を設定すると、完全に削除されます。 – kcoppock

0

listviewのdividerプロパティにheightとcolorを設定できます。

3

こんにちは、リストビューの区切りの高さと色を変更することができます。

<ListView 
    android:id="@+id/android:list" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:divider="#FFCC00" 
    android:dividerHeight="4px"/> 
関連する問題