Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/189.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为什么我的列表视图的背景被暴露?_Android_Listview_Background - Fatal编程技术网

Android 为什么我的列表视图的背景被暴露?

Android 为什么我的列表视图的背景被暴露?,android,listview,background,Android,Listview,Background,某些主要内容和所有节标题不填充其列表视图行。有什么问题吗 date_section layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" andr

某些主要内容和所有节标题不填充其列表视图行。有什么问题吗

date_section  layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="#A1A1A1"
    >
<TextView android:layout_width="fill_parent"

                android:id="@+id/post_date"
                android:layout_height="wrap_content"
                android:textStyle = "normal"
                android:textColor="#ffffff"
                android:background="#A1A1A1"
                android:textSize="15dp"
                android:minHeight="0dp"
                 />
</LinearLayout>                

date\u区段布局:
单元布局:

<?xml version="1.0" encoding="utf-8"?>
<!-- hi new  changes -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/list_background"
    >




    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:minHeight="80dp"
        android:layout_weight="0.8">

            <TextView android:layout_width="fill_parent"
                android:id="@+id/post_title"
                android:layout_height="wrap_content"
                android:textStyle = "normal"
                android:textColor="#202020"
                android:textSize="15dp"
                android:paddingTop="5dp"
                android:paddingLeft="5dp"
                android:paddingRight="5dp"
                android:text="test"
                 />
            <TextView android:layout_width="fill_parent"

                android:id="@+id/post_execerpt"
                android:textColor="#888888"
                android:textStyle = "italic"
                android:textSize="14dp" 
                android:layout_height="wrap_content"
                android:paddingLeft="5dp"
                android:paddingRight="5dp"
                android:lines="2"
                android:text="test"
                />
    </LinearLayout>

</LinearLayout>

date\u节.xml
文件中,将此行添加到
TextView

android:layout_width="fill_parent"

祝你好运

试着像hsnepen提到的那样,将文本视图宽度设置为“填充父对象”,确保列表项的“宽度填充父项”。@hsn已将其设置为“填充父项”。我正在编辑问题并添加布局代码。除了设置文本之外,是否在代码中更改任何
TextView
s的参数?是否可以尝试删除
android:textStyle=“normal”
行?这只是猜测!