I have a grid of four buttons in my layout. I have chained them horizontally, so that the space to the left, right, and between the buttons is evenly weighted.
screenshot of my app's buttons
Can I make the two rows of buttons have the same amount of space vertically between them so it doesn't look uneven? I would rather not just center them vertically like I did to achieve the horizontal spacing, which done thanks to @AdamK of this post: Evenly spacing views using ConstraintLayout
activity_main.xml:
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.jason.notifier.MainActivity" tools:layout_editor_absoluteY="81dp" tools:layout_editor_absoluteX="0dp"> <ImageView android:id="@+id/imageView3" android:layout_width="388dp" android:layout_height="164dp" app:srcCompat="@drawable/banner" android:layout_marginStart="8dp" app:layout_constraintTop_toTopOf="parent" android:layout_marginTop="4dp" android:layout_marginLeft="8dp" app:layout_constraintLeft_toLeftOf="parent" /> <Button android:id="@+id/testbutton" android:layout_width="171dp" android:layout_height="136dp" android:onClick="sampleNotification" android:text="Test" app:layout_constraintRight_toLeftOf="@+id/settingsbutton" app:layout_constraintLeft_toLeftOf="parent" android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/historybutton" /> <Button android:id="@+id/settingsbutton" android:layout_width="171dp" android:layout_height="136dp" android:text="Settings" android:onClick="settingsbutton" app:layout_constraintRight_toRightOf="parent" app:layout_constraintLeft_toRightOf="@+id/testbutton" android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/pingbutton" /> <Button android:id="@+id/pingbutton" android:layout_width="171dp" android:layout_height="136dp" android:onClick="pingbutton" android:text="ping" android:layout_marginTop="-31dp" app:layout_constraintTop_toBottomOf="@+id/textView2" app:layout_constraintRight_toRightOf="parent" app:layout_constraintLeft_toRightOf="@+id/historybutton" /> <Button android:id="@+id/historybutton" android:layout_width="171dp" android:layout_height="136dp" android:onClick="historybutton" android:text="History" android:layout_marginTop="-31dp" app:layout_constraintTop_toBottomOf="@+id/textView2" app:layout_constraintRight_toLeftOf="@+id/pingbutton" app:layout_constraintLeft_toLeftOf="parent" /> <TextView android:id="@+id/textView2" android:layout_width="358dp" android:layout_height="42dp" android:text="TextView" android:gravity="center" tools:layout_editor_absoluteX="2dp" android:layout_marginTop="8dp" app:layout_constraintTop_toBottomOf="@+id/imageView3" /> </android.support.constraint.ConstraintLayout>