Мне нужно поместить TextView и EditText в один и тот же макет ограничения выигрыша строки и сохранить их выравнивание друг друга! код ниже создает изображение, подобное приведенному ниже:
<?xml version="1.0" encoding="utf-8"?>
<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">
<TextView
android:id="@+id/serverIpAddr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="192.168.1.11"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<EditText
android:id="@+id/serverPort"
style="@style/Widget.AppCompat.EditText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:layout_marginLeft="0dp"
android:layout_marginTop="0dp"
android:ems="10"
android:inputType="number"
android:text="8080"
android:textAppearance="@style/TextAppearance.AppCompat.Body1"
app:layout_constraintStart_toEndOf="@+id/serverIpAddr"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Теперь это выглядит некрасиво, журналы TextView и EditText выравниваются по горизонтали правильно, TextView немного выше EditText
введите описание изображения здесь