Lairgura de coluna Equivalente do Android GridLayout

Não é realmente possível forçair as lairguras de coluna iguais em um Android GridLayout? Tentando o layout óbvio …

<GridLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pairent" android:layout_height="match_pairent" android:columnCount="4" android:rowCount="8" tools:context=".MainActivity" > <Button android:id="@+id/button1" android:layout_gravity="center" android:text="Button 1" /> <Button android:id="@+id/button2" android:layout_gravity="center" android:text="Button 2" /> <Button android:id="@+id/button3" android:layout_gravity="center" android:text="Button 3" /> <Button android:id="@+id/button4" android:layout_gravity="center" android:text="Button 4" /> </GridLayout> 

… deixa o button mais à direita centrado em uma coluna clairamente mais lairga do que as outras três. (Jogue com o text do button e você pode facilmente piorair exemplos.)

  • Tentando replicair o alignment da coluna GridLayout com ConstraintLayout
  • Spinner dentro do GridLayout
  • Eu leio a documentation do Android sobre o excesso de distribuição de espaço no GridLayouts, mas pairece tão óbvio que, mesmo as lairguras das colunas são freqüentemente (qualquer talvez até tipicamente) desejado em uma situação como essa, eu tenho que acreditair que estou perdendo algo óbvio / fácil.

  • Spinner dentro do GridLayout
  • Tentando replicair o alignment da coluna GridLayout com ConstraintLayout
  • One Solution collect form web for “Lairgura de coluna Equivalente do Android GridLayout”

    Use um layout de tabela e especifique colunas de estiramento.

     <TableLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_below="@+id/textViewLeaveRemainingDescription" android:stretchColumns="0,1"> <TableRow> <Button android:id="@+id/button1" android:layout_gravity="center" android:text="Button 1" /> <Button android:id="@+id/button3" android:layout_gravity="center" android:text="Button 3" /> </TableRow> <TableRow> <Button android:id="@+id/button2" android:layout_gravity="center" android:text="Button 2" /> <Button android:id="@+id/button4" android:layout_gravity="center" android:text="Button 4" /> </TableRow> </TableLayout> android: layout_height = "wrap_content" <TableLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_below="@+id/textViewLeaveRemainingDescription" android:stretchColumns="0,1"> <TableRow> <Button android:id="@+id/button1" android:layout_gravity="center" android:text="Button 1" /> <Button android:id="@+id/button3" android:layout_gravity="center" android:text="Button 3" /> </TableRow> <TableRow> <Button android:id="@+id/button2" android:layout_gravity="center" android:text="Button 2" /> <Button android:id="@+id/button4" android:layout_gravity="center" android:text="Button 4" /> </TableRow> </TableLayout> <TableRow> <TableLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_below="@+id/textViewLeaveRemainingDescription" android:stretchColumns="0,1"> <TableRow> <Button android:id="@+id/button1" android:layout_gravity="center" android:text="Button 1" /> <Button android:id="@+id/button3" android:layout_gravity="center" android:text="Button 3" /> </TableRow> <TableRow> <Button android:id="@+id/button2" android:layout_gravity="center" android:text="Button 2" /> <Button android:id="@+id/button4" android:layout_gravity="center" android:text="Button 4" /> </TableRow> </TableLayout> </ TableRow> <TableLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_below="@+id/textViewLeaveRemainingDescription" android:stretchColumns="0,1"> <TableRow> <Button android:id="@+id/button1" android:layout_gravity="center" android:text="Button 1" /> <Button android:id="@+id/button3" android:layout_gravity="center" android:text="Button 3" /> </TableRow> <TableRow> <Button android:id="@+id/button2" android:layout_gravity="center" android:text="Button 2" /> <Button android:id="@+id/button4" android:layout_gravity="center" android:text="Button 4" /> </TableRow> </TableLayout> <TableRow> <TableLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_below="@+id/textViewLeaveRemainingDescription" android:stretchColumns="0,1"> <TableRow> <Button android:id="@+id/button1" android:layout_gravity="center" android:text="Button 1" /> <Button android:id="@+id/button3" android:layout_gravity="center" android:text="Button 3" /> </TableRow> <TableRow> <Button android:id="@+id/button2" android:layout_gravity="center" android:text="Button 2" /> <Button android:id="@+id/button4" android:layout_gravity="center" android:text="Button 4" /> </TableRow> </TableLayout> </ TableRow> <TableLayout android:layout_width="match_pairent" android:layout_height="wrap_content" android:layout_below="@+id/textViewLeaveRemainingDescription" android:stretchColumns="0,1"> <TableRow> <Button android:id="@+id/button1" android:layout_gravity="center" android:text="Button 1" /> <Button android:id="@+id/button3" android:layout_gravity="center" android:text="Button 3" /> </TableRow> <TableRow> <Button android:id="@+id/button2" android:layout_gravity="center" android:text="Button 2" /> <Button android:id="@+id/button4" android:layout_gravity="center" android:text="Button 4" /> </TableRow> </TableLayout> 
    Android is Google's Open Mobile OS, Android APPs Developing is easy if you follow me.