2010-10-21 5 views
1

Je suis en train d'ajouter une bordure inférieure mon listview dans Android Le code i utilisé estfrontière Bas pour une vue de liste dans 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" 
    /> 

Il travaille quand il y a seulement peur que pas d'éléments. Mais ne fonctionne pas lorsqu'il n'y a pas d'articles est plus je veux dire quand les éléments ne peuvent pas afficher dans l'écran Merci

La mise en page entière i utilisé

>

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

+0

Pouvez-vous fournir la mise en page entière? Vous devez avoir ListView dans le contexte de la mise en page entière afin de déterminer comment ancrer votre listview à la bordure inférieure ou au moins s'assurer que la bordure inférieure n'est pas dépassée par la listview. –

+0

Merci d'avoir réfléchi à ma question ... J'ai ajouté la mise en page complète avec ma question ... Merci –

+0

anambullan: Que considérez-vous comme une «frontière inférieure» être? – CommonsWare

Répondre

0

Labeep Si vous vérifiez les diviseurs ne sont que dans les listes, il manque le bas ainsi que le haut. Essayez d'utiliser la balise de forme et définissez-le comme arrière-plan de votre listVIew.

Ou dans le cas où vous avez besoin d'un diviseur de fond seulement?

Juste avoir un tag de vue.

Questions connexes