/ / Tableaux vides, bordure et poids - Android, android-layout, android-tablelayout

Tableau et bordure des cellules vides de la table de mise en forme Android - Android, android-layout, android-tablelayout

Pour mon application Android, je dois créer un tableaumise en page composée de cellules de différentes couleurs divisées par une bordure noire. Les cellules doivent être vides, seule la couleur de fond. Je le fais comme ci-dessous mais il n'y a pas de frontière et la division horizontale est incorrecte. Cela ressemble à 3 cellules égales et non à layout_weight 0.25 / 0.25 / 0.5. Tout le monde peut conseiller?

<TableLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="right"
android:background="#000000">


<TableRow
android:id="@+id/tableRow5_11"
android:layout_width="wrap_content"
android:layout_height="80dp"
android:dividerPadding="5dp"
android:background="#000000">

<TextView
android:id="@+id/textView1"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:background="#00FF00"
android:layout_weight="0.25"/>
<TextView
android:id="@+id/textView2"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:background="#00FF00"
android:layout_weight="0.25"
android:dividerPadding="5dp"
/>
<TextView
android:id="@+id/textView3"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:background="#000000"
android:layout_weight="0.5"
android:layout_margin="2dp"/>

</TableRow>
</TableLayout>

Réponses:

0 pour la réponse № 1

Change ça:

<TableRow
android:id="@+id/tableRow5_11"
android:layout_width="match_parent"

J'espère que cela t'aides.