2011-03-18 80 views
2

在我的自定义列表活动中,我在我的列表活动中添加了标题,它在列表填充时正常工作,当它为空时标题也消失了,因此是否有任何选项可放置永久标题在列表活动中。使标题永久可见

我的XML代码,

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent" 
android:background="@drawable/background"> 

<ListView 
    android:id="@android:id/list" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:layout_weight="1" 
    android:layout_marginTop="10dip" 
    android:layout_marginBottom="10dip" 
    android:drawSelectorOnTop="false" 
    android:cacheColorHint="@color/black"/> 

<TextView 
    android:id="@android:id/empty" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:gravity="center_vertical" 
    android:textSize="24dip" 
    android:text="@string/empty"/> 

ad_header.xml

<LinearLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:myapp="http://schemas.android.com/apk/res/com.example.Password" 
android:layout_height="fill_parent" 
android:layout_width="fill_parent" 
android:orientation="vertical"> 

<ImageView 
    android:id="@+id/add" 
    android:layout_height="wrap_content" 
    android:layout_width="fill_parent" 
    android:layout_gravity="center" 
    android:layout_weight="1" 
    android:paddingTop="5dip" 
    android:paddingBottom="5dip" 
    android:src="@drawable/add_new_item" 
    android:background="@color/white"/> 

感谢。

+0

地方XML代码 – 2011-03-18 05:27:24

回答