#android #android-studio #android-layout #android-constraintlayout #android-button
#Android #android-studio #android-layout #android-constraintlayout #android-кнопка
Вопрос:
<androidx.constraintlayout.widget.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=".MainActivity" >
<Button
android:id="@ id/button_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<Button
android:id="@ id/button_2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_2"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent />
</androidx.constraintlayout.widget.ConstraintLayout>
Ответ №1:
Вы можете использовать:
<Button
android:id="@ id/button_3"
android:text="button_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />
<Button
android:id="@ id/button_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="button_4"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />