Why is the button compacted or off-screen in Android Studio?
You know I have a question about why I have the "Add" button that way, it is practically as if it were leaving the activity, even the text "Add data ..." is also wrong because of this, I have to say that I'm still new to all this from the android studio, so anything could help me, I tried a lot but I couldn't fully show the button, only the part that you see in the image (I tried using LinearLayout as well)
this is how I would like it to look
I add the xml code
<?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:id="@+id/ConstraintLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/login_degradado"
tools:context=".NuevoPacienteActivity">
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_marginStart="20dp"
android:layout_marginEnd="20dp"
android:layout_marginBottom="10dp"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="15dp"
app:cardElevation="10dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/ConstraintLayout2"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/textView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:paddingBottom="16dp"
android:text="@string/agregue_datos_del_paciente"
android:textAlignment="center"
android:textColor="@color/black"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout8"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_chainStyle="packed" />
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout8"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:fadeScrollbars="false"
android:importantForAutofill="no"
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout9"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textView"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextRutPa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/custom_person_icon"
android:drawablePadding="12dp"
android:hint="@string/rutPa"
android:inputType="textPersonName"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout9"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:fadeScrollbars="false"
android:importantForAutofill="no"
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout10"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/textInputLayout8"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout8"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextNombrePa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/custom_person_icon"
android:drawablePadding="12dp"
android:hint="@string/nombre"
android:inputType="textPersonName"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout10"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="1dp"
android:fadeScrollbars="false"
android:importantForAutofill="no"
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout11"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@+id/textInputLayout9"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout9"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextApellidoPa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/custom_person_icon"
android:drawablePadding="12dp"
android:hint="@string/apellidos"
android:inputType="textPersonName"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout11"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:fadeScrollbars="false"
android:importantForAutofill="no"
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout12"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout10"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextEmailPa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/custom_email_icon"
android:drawablePadding="12dp"
android:hint="@string/emailPa"
android:inputType="textEmailAddress"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout12"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:fadeScrollbars="false"
android:importantForAutofill="no"
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout13"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout11"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextPhonePa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/custom_phone_icon"
android:drawablePadding="12dp"
android:hint="@string/n_mero_de_celularPa"
android:inputType="phone"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout13"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:fadeScrollbars="false"
android:importantForAutofill="no"
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/textInputLayout14"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout12"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextMotivoConsultaPa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/custom_phone_icon"
android:drawablePadding="12dp"
android:hint="@string/motivo_de_consulta"
android:inputType="text"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout14"
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:fadeScrollbars="false"
android:importantForAutofill="no"
app:errorEnabled="true"
app:layout_constraintBottom_toTopOf="@+id/buttonAgregarPa"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout13"
tools:ignore="TextContrastCheck,TouchTargetSizeCheck">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/editTextDiagnosticoPa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/custom_phone_icon"
android:drawablePadding="12dp"
android:hint="@string/diagnostico"
android:inputType="text"
android:textColor="@color/black"
android:textSize="14sp"
tools:ignore="TextContrastCheck" />
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.button.MaterialButton
android:id="@+id/buttonAgregarPa"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:text="@string/agregarPa"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textInputLayout14"
tools:ignore="TouchTargetSizeCheck" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
from Recent Questions - Stack Overflow https://ift.tt/3slkMiA
https://ift.tt/eA8V8J
Comments
Post a Comment