Нижняя граница для просмотра списка в Android - PullRequest
1 голос
/ 21 октября 2010

Я пытаюсь добавить нижнюю границу моего списка в 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 Ответ

0 голосов
/ 06 октября 2011

Labeep, если вы проверяете, что разделители находятся только в элементах списка, он пропускает как нижнюю, так и верхнюю часть.Попробуйте использовать тег shape и установить в качестве фона для вашего listVIew.

Или, если вам нужен только нижний разделитель?

Просто используйте тег просмотра.

...