-
-
Save ralphgabrielle/3530c837990598ce5e34ab32c1e23266 to your computer and use it in GitHub Desktop.
Table Layout centering uneven row.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.constraint.ConstraintLayout | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:tools="http://schemas.android.com/tools" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context=".MainActivity"> | |
<TableLayout android:id="@+id/tableLayout" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
app:layout_constraintBottom_toBottomOf="parent" | |
app:layout_constraintLeft_toLeftOf="parent" | |
app:layout_constraintRight_toRightOf="parent" | |
app:layout_constraintTop_toTopOf="parent"> | |
<TableRow | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<Button | |
android:text="ONE" | |
android:layout_weight="1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_column="1"/> | |
<Button | |
android:text="TWO" | |
android:layout_weight="1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_column="2"/> | |
<Button | |
android:text="THREE" | |
android:layout_weight="1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_column="1"/> | |
<Button android:text="FOUR" | |
android:layout_weight="1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_column="2"/> | |
</TableRow> | |
<TableRow android:weightSum="4" | |
android:gravity="center" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content"> | |
<Button | |
android:text="ONE" | |
android:layout_weight="1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_column="1"/> | |
<Button | |
android:text="TWO" | |
android:layout_weight="1" | |
android:layout_width="wrap_content" | |
android:layout_height="wrap_content" | |
android:layout_column="2"/> | |
</TableRow> | |
</TableLayout> | |
</android.support.constraint.ConstraintLayout> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment