Итак, во-первых, да, здесь есть похожие посты, и я не смог решить мою проблему, прочитав их. Мне нужно центрировать две кнопки в макете ограничения, как показано ниже.
![enter image description here](https://i.stack.imgur.com/PKmNs.png)
Кнопки расположены под несколькими метками, которые вы сможете увидеть в конце XML. В настоящее время результирующий макет выглядит следующим образом.
![enter image description here](https://i.stack.imgur.com/07zMz.png)
Результат, к которому я стремлюсь, похож на первое изображение, поэтому две кнопки должны быть центрированы под текстовым представлением с надписью «Без местоположения».
Я довольно новичок в использовании макетов ограничений. Я читал, используя "layout_constraintHorizont_bias", это был лучший подход, но мне не повезло с этим. Xml для моего макета ниже, любая помощь или руководство высоко ценится.
<android.support.constraint.ConstraintLayout
android:layout_width="match_parent"
android:gravity="center_vertical|center"
android:layout_height="wrap_content"
android:id="@+id/checkIn_layout">
<TextView
android:id="@+id/checkIn_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="Manual Check-in"
android:textColor="#FFFFFF"
android:textSize="16dp"
android:textStyle="normal"
android:fontFamily="sans-serif"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/checkIn_duration"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:text="00:00:00"
android:textColor="#FFFFFF"
android:fontFamily="sans-serif-medium"
android:textSize="50dp"
android:textStyle="normal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkIn_title" />
<TextView
android:id="@+id/checkIn_location"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:drawableLeft="@drawable/icon_location"
android:drawablePadding="5dp"
android:text="Glow New Media"
android:textColor="#FFFFFF"
android:fontFamily="sans-serif"
android:textSize="16dp"
android:textStyle="normal"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/checkIn_duration" />
<Button
android:id="@+id/checkIn_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Check Out"
android:paddingLeft="25dp"
android:paddingRight="25dp"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:background="@drawable/RoundedButton"
android:textColor="#399AEA"
android:textSize="16dp"
android:fontFamily="sans-serif-medium"
android:textStyle="normal"
android:padding="10dp"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toLeftOf="@+id/onduty_button"
app:layout_constraintTop_toBottomOf="@+id/checkIn_location"
app:layout_constraintHorizontal_bias="0.5" />
<ImageButton
android:id="@+id/onduty_button"
android:layout_marginEnd="8dp"
android:layout_marginStart="8dp"
android:layout_marginTop="8dp"
android:padding="10dp"
android:paddingLeft="25dp"
android:paddingRight="25dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/ic_power"
android:background="@drawable/PowerButton"
app:layout_constraintTop_toBottomOf="@+id/checkIn_location"
app:layout_constraintLeft_toRightOf="@+id/checkIn_button"
app:layout_constraintHorizontal_bias="0.5" />
</android.support.constraint.ConstraintLayout>