I am creating the registration page where is created a button but the issue is the button is not placing if I comment the code for that button all other design is starting showing in the design section but if is un-comment the code for the button the design disappear and the black screen started showing
Here is my 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:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".RegisterActivity"
android:background="@drawable/bb">
<TextView
android:id="@ id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Register"
android:textColor="@color/colorwhite"
android:textSize="36sp"
android:textStyle="bold"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintVertical_bias="0.13" />
<EditText
android:id="@ id/inputUsername"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="32dp"
android:layout_marginTop="40dp"
android:layout_marginEnd="32dp"
android:background="@drawable/input_bg"
android:drawableLeft="@drawable/ic_person"
android:drawablePadding="10dp"
android:ems="10"
android:hint="Username"
android:inputType="textPersonName"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:textColor="@color/colorwhite"
android:textColorHint="@color/black"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@ id/logo" />
<EditText
android:id="@ id/inputEmail"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/input_bg"
android:drawableLeft="@drawable/ic_email"
android:drawablePadding="10dp"
android:ems="10"
android:hint="Email"
android:inputType="textPersonName"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:textColor="@color/colorwhite"
android:textColorHint="@color/black"
app:layout_constraintEnd_toEndOf="@ id/inputUsername"
app:layout_constraintStart_toStartOf="@ id/inputUsername"
app:layout_constraintTop_toBottomOf="@ id/inputUsername" />
<EditText
android:id="@ id/inputPassword"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/input_bg"
android:drawableLeft="@drawable/ic_security"
android:drawablePadding="10dp"
android:ems="10"
android:hint="******"
android:inputType="textPersonName"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:textColor="@color/colorwhite"
android:textColorHint="@color/black"
app:layout_constraintEnd_toEndOf="@ id/inputEmail"
app:layout_constraintStart_toStartOf="@ id/inputEmail"
app:layout_constraintTop_toBottomOf="@ id/inputEmail" />
<EditText
android:id="@ id/inputConformPassword"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@drawable/input_bg"
android:drawableLeft="@drawable/ic_security"
android:drawablePadding="10dp"
android:ems="10"
android:hint="******"
android:inputType="textPersonName"
android:paddingLeft="20dp"
android:paddingTop="10dp"
android:paddingRight="10dp"
android:paddingBottom="10dp"
android:textColor="@color/colorwhite"
android:textColorHint="@color/black"
app:layout_constraintEnd_toEndOf="@ id/inputPassword"
app:layout_constraintStart_toStartOf="@ id/inputPassword"
app:layout_constraintTop_toBottomOf="@ id/inputPassword" />
<!-- <Button-->
<!-- android:id="@ id/btnRegister"-->
<!-- android:layout_width="0dp"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_marginTop="24dp"-->
<!-- android:background="@drawable/btn_bg"-->
<!-- android:text="Register"-->
<!-- app:layout_constraintEnd_toEndOf="@ id/inputConformPassword"-->
<!-- app:layout_constraintStart_toStartOf="@ id/inputConformPassword"-->
<!-- app:layout_constraintTop_toBottomOf="@ id/inputConformPassword" />-->
<TextView
android:id="@ id/alreadyHaveAccount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:shadowColor="@color/colorwhite"
android:text="Already Have an Account?"
android:textColor="@color/colorwhite"
app:layout_constraintEnd_toEndOf="@ id/btnRegister"
app:layout_constraintStart_toStartOf="@ id/btnRegister"
app:layout_constraintTop_toBottomOf="@ id/btnRegister" />
</androidx.constraintlayout.widget.ConstraintLayout>
How to solve this?
CodePudding user response:
I solved this problem by just making Theme.MaterialComponents.DayNight.DarkActionBar
to Theme.MaterialComponents.DayNight.NoActionBar
from Values>Themes>Themes.xml. By doing this the problem solved for me