代码之家  ›  专栏  ›  技术社区  ›  Labeeb Panampullan

android中列表视图的下边框

  •  1
  • Labeeb Panampullan  · 技术社区  · 15 年前

    我正在尝试在android中添加一个底部边框

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

    当只有很少的物品时,它才起作用。但当没有更多的项目时就不起作用了 我是说当项目不能在屏幕上显示时 谢谢

    我使用的整个布局

     <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 回复  |  直到 15 年前
        1
  •  0
  •   Jayshil Dave    14 年前

    Labeep如果您检查分隔符只在列表项中,它会忽略底部和顶部。尝试使用shape标记和set is作为listVIew的背景。

    只要有一个视图标签。