0

在普通列表视图中,分隔线被认为是,但是当我切换到全屏模式时,它变得太暗了。如何控制线条的颜色?

为了便于理解,请在此处查看图片:https ://dl.dropbox.com/u/15065300/layout.png

活动代码 XML

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

<TextView
        android:id="@+id/textView0"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#123456"
        android:drawableLeft="@drawable/ic_launcher"
        android:drawablePadding="6sp"
        android:text="@string/app_name"
        android:gravity="center_vertical"
        android:padding="8sp"
        android:textSize="22sp"
        android:textStyle="bold"
        android:textColor="#ffffff"/> 


        <!-- List View -->
    <ListView
        android:id="@+id/list_view"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="#ffffff"/>

</LinearLayout>

List_Item 的代码

<?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" >

    <!-- Product Name -->

     <com.examdple.customproduct.CustomTextView

            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textColor="#111111"
            android:paddingTop="10sp"
            android:id="@+id/product_list"
            android:paddingLeft="20sp"
            android:paddingBottom="5sp"
            android:textSize="16sp" />

</LinearLayout>

整个项目在这里http://www.mediafire.com/?umt91j6acq8b6gm

4

1 回答 1

1

你应该使用android:divider属性:

<ListView
    android:id="@+id/list_view"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#ffffff"
    android:divider="#FFFF0000"
    android:dividerHeight="1dip"/>
于 2013-01-06T16:58:56.643 回答