lundi 22 janvier 2018

How to split a TableLayout evenly

I understand this might be a duplicate of another question somewhere, but I cannot seem to find it. I am trying to have a TableLayout have 2 columns evenly by itself. Now, I do not know if this is even possible, I am new with TableLayout and TableRow, so I may be going about this the wrong way. I am dynamically creating an array of checkboxes. I want two checkboxes on each line, regardless of text size, currently (I will have to play around with the text size in the future, anyway).

    <TableLayout
        android:id="@+id/CheckBoxLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    </TableLayout>

Now, I am completely open to different ways. I want it to be clean as I don't want it to get messy. I have tried the stretchColumns, width, and weight in different formats. I am open to TableLayout - TableRow - ? if it is easier. If there is a way with TableLayout itself, that is what I would prefer. I have seen it with a view/textView, but I do not know how I would even go about that when I am creating a dynamic checkbox.

All help and comments are appreciated!!




Aucun commentaire:

Enregistrer un commentaire