android中列表视图的下边框

时间:2010-10-21 07:04:29

标签: android listview border

我正在尝试在android中添加我的listview的底部边框 我使用的代码是

<ListView 
  android:id="@+id/listview"
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content" 
  android:layout_weight="1" 
  android:scrollbars="horizontal" 
  android:background="#ffffff"
  android:cacheColorHint="#ffffff"
  /> 

当只有至少没有物品时,它正在工作。但是当没有项目更多时,不工作 我的意思是当项目无法在屏幕上显示 感谢

我使用的整个布局

    &GT;

 <LinearLayout
    android:orientation="horizontal"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:background="@drawable/navigationbar"
    >

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:background="@drawable/search_icon"/>

 <LinearLayout
    android:orientation="horizontal"
    android:layout_width="5dp"
    android:layout_height="wrap_content"/>

<EditText   
    android:layout_width="220dp"
    android:layout_height="wrap_content"
    android:layout_marginTop="4dp"
    android:layout_marginBottom="2dp"
    android:singleLine="true"
    android:id="@+id/categoryListEditText"/>    

 <LinearLayout
    android:orientation="horizontal"
    android:layout_width="5dp"
    android:layout_height="wrap_content"/>

<Button
    android:layout_width="50dp"
    android:layout_height="wrap_content"
    android:layout_marginTop="4dp"
    android:layout_marginBottom="2dp"
    android:textSize="10dp"
    android:textStyle="bold"
    android:background="@drawable/switch_list_button"
    android:id="@+id/switchListsButton"/>

</LinearLayout>
    <TextView   style="@style/firstBannerTextView"
    android:text="Type a category name to filter the List."/>



    <TextView   
    style="@style/secondBannerTextView"     
    android:id="@+id/categoryList"
    />

<ListView 
  android:id="@+id/listview"
  android:layout_width="fill_parent" 
  android:layout_height="wrap_content" 
  android:layout_weight="1" 
  android:scrollbars="horizontal" 
  android:background="#ffffff"
  android:cacheColorHint="#ffffff"
  /> 

1 个答案:

答案 0 :(得分:0)

如果您检查分隔符仅在列表项内,它会错过底部和顶部。尝试使用shape标签,并将set设置为listVIew的背景。

或者如果您只需要一个底部分隔符?

只需拥有一个视图标记。

相关问题