2012-07-31 4 views
0

Image de l'interface Android: http://tinypic.com/view.php?pic=avht6w&s=6Comment rendre le dernier TableRow visible?

Comme on le voit dans l'image ci-dessus, je veux un petit frontières au bas et le haut du listView blanc. Le problème est, comme je l'ai mis à tableRow pour être android: paddingBottom = "20dp" la bordure ne s'affiche jamais en bas. Il semble que, si la taille de la liste des vues est assez grande, rien d'autre ne sera affiché après (voir l'exemple de code ci-dessous pour comprendre). J'ai testé différentes approches pour résoudre le problème, l'une est de définir l'attribut paddingBottom dans la TableRow suivante (les bordures de table) mais cela ne fonctionnera que si la hauteur de listView est exacte de la hauteur des écrans et non de la taille.

Pourquoi est-ce que je règle la taille de listView à un nombre fixe comme 415dp? Eh bien, c'est dû à un autre problème que je ne sais pas comment résoudre. Si, par exemple, je définis la taille de listViews sur fill_parent, l'arrière-plan ne couvrira que le nombre d'éléments de la liste. Je veux toujours que l'arrière-plan des listes soit rempli à 20dp depuis le bas de l'interface.

Si quelqu'un a des idées sur la façon dont je peux afficher la bordure en bas et que l'arrière-plan des listes est toujours visible, même s'il n'est pas rempli d'éléments, postez vos idées! /Merci beaucoup!

<?xml version="1.0" encoding="utf-8"?> 

<TableLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent" 
android:orientation="vertical" 
android:background="@drawable/orginalbild" 
android:gravity="center|top" 
android:stretchColumns="1" 
android:weightSum="1.0" 
android:fillViewport="true"> 

<TableRow 
    android:background="#000000" 
    > 
<TextView 
    android:layout_marginTop="0.15dp" 
    android:layout_width="fill_parent" 
    android:layout_height="2dp" 
    android:background="#999999" 
    android:layout_weight="1"> 
</TextView> 


</TableRow> 


<TableRow 
    android:background="#999999" 

    > 
<TextView 
    android:background="#999999" 
    android:id="@+id/show_task_feedback_title" 
    android:layout_width="0dip" 
    android:layout_height="28dp" 
    android:layout_weight="0.8" 
    android:text="@string/LatestFeedbackTitle" 
    android:textColor="#ffffff" 
    android:textSize="17dp" 
    android:shadowColor="#FFFFFF" 
    android:layout_marginBottom="0.15dp" 
    android:textAppearance="?android:attr/textAppearanceMedium"> 
    </TextView> 

    <TextView 

     android:layout_width="0dip" 
     android:layout_height="28dp" 
     android:layout_gravity="center" 
     android:layout_weight="0.08" > 
    </TextView> 


<Button 
     android:id="@+id/latest_feedback_help_button" 
     android:layout_width="0dip" 
     android:layout_height="28dp" 
     android:layout_gravity="center" 
     android:background="@drawable/help_button" 
     android:layout_weight="0.12" 
     android:layout_marginBottom="0.15dp" 
     /> 

</TableRow> 

<TableRow 
android:background="#212421"> 
<TextView 
    android:layout_width="fill_parent" 
    android:layout_height="1dp" 
    android:background="#ffffff" 
    android:layout_marginTop="0.15dp" 
    android:layout_weight="1"> 
</TextView> 
</TableRow> 



<TableRow> 
<TextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:layout_weight="0.25" /> 
</TableRow> 


<TableRow 
android:paddingLeft="24dp" 
android:paddingRight="24dp"> <--------THE BLACK BRODER AT THE TOP OF THE LISTVIEW 

      <TextView 
       android:background="#000000" 
       android:layout_width="0dip" 
       android:layout_height="0.5dp" 
       android:layout_weight="1" > 
      </TextView> 

     </TableRow> 

<TableRow 
android:paddingLeft="24dp" 
android:paddingRight="24dp" 
android:paddingBottom="20dp" <------(paddingBottom attribute which causes the problem) 
> 
     <ListView 

       android:background="#ffffff" 
       android:id="@+id/bookmarks_list" 
       android:layout_width="0dip" 
       android:layout_height="415dp" 
       android:gravity="left" 
       android:layout_weight="1" 
       /> 
     </TableRow> 

    <TableRow> <---THE BLACK BRODER AT THE BOTTOM OF THE LISTVIEW(not being displayed) 

     <TextView 
       android:background="#000000" 
       android:layout_width="0dip" 
       android:layout_height="0.5dp" 
       android:layout_weight="1" > 
      </TextView> 
     </TableRow> 

</TableLayout> 

Répondre

0

Voir si cela aide.

<?xml version="1.0" encoding="utf-8"?> 
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:background="@drawable/orginalbild" 
    android:fillViewport="true" 
    android:gravity="center|top" 
    android:orientation="vertical" 
    android:stretchColumns="1" 
    android:weightSum="1.0" > 

    <TableRow android:background="#000000" > 

     <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="2dp" 
      android:layout_marginTop="0.15dp" 
      android:layout_weight="1" 
      android:background="#999999" > 
     </TextView> 
    </TableRow> 

    <TableRow android:background="#999999" > 

     <TextView 
      android:id="@+id/show_task_feedback_title" 
      android:layout_width="0dip" 
      android:layout_height="28dp" 
      android:layout_marginBottom="0.15dp" 
      android:layout_weight="0.8" 
      android:background="#999999" 
      android:shadowColor="#FFFFFF" 
      android:text="@string/LatestFeedbackTitle" 
      android:textAppearance="?android:attr/textAppearanceMedium" 
      android:textColor="#ffffff" 
      android:textSize="17dp" > 
     </TextView> 

     <TextView 
      android:layout_width="0dip" 
      android:layout_height="28dp" 
      android:layout_gravity="center" 
      android:layout_weight="0.08" > 
     </TextView> 

     <Button 
      android:id="@+id/latest_feedback_help_button" 
      android:layout_width="0dip" 
      android:layout_height="28dp" 
      android:layout_gravity="center" 
      android:layout_marginBottom="0.15dp" 
      android:layout_weight="0.12" 
      android:background="@drawable/help_button" /> 
    </TableRow> 

    <TableRow android:background="#212421" > 

     <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="1dp" 
      android:layout_marginTop="0.15dp" 
      android:layout_weight="1" 
      android:background="#ffffff" > 
     </TextView> 
    </TableRow> 

    <TableRow> 

     <TextView 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" 
      android:layout_weight="0.25" /> 
    </TableRow> 

    <TableRow 
     android:paddingTop="0.5dp" 
     android:paddingBottom="0.5dp" 
     android:background="#000000" 
     android:layout_marginLeft="24dp" 
     android:layout_marginRight="24dp" 
     android:layout_marginBottom="20dp" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent" > 

     <ListView 
      android:id="@+id/bookmarks_list" 
      android:layout_width="match_parent" 
      android:layout_height="match_parent" 
      android:layout_weight="1" 
      android:background="#ffffff" 
      android:gravity="left" 
      android:entries="@array/listitems" /> 
    </TableRow> 

</TableLayout> 
+0

Cela a fonctionné. Vous êtes un ange. Merci! –

Questions connexes