I am trying to make the input text inside an editText come out at the bottom of it. When I use , <item name="android:gravity">bottom</item>
the hint changes its position but the input text does not.
This is my xml code:
<com.google.android.material.textfield.TextInputLayout
android:id="@+id/registrationUsernameEditTextLayout"
style="@style/grayEditTextLayoutHelperText"
android:layout_width="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:hint="@string/username"
app:helperTextTextColor="@color/green"
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.35">
<com.google.android.material.textfield.TextInputEditText
android:id="@+id/registrationUsernameEditText"
style="@style/grayEditText"
android:layout_width="match_parent"
android:inputType="text" />
</com.google.android.material.textfield.TextInputLayout>
<style name="grayEditTextLayout" parent="Widget.MaterialComponents.TextInputLayout.OutlinedBox">
<item name="android:layout_height">55sp</item>
<item name="hintTextColor">@color/gray</item>
<item name="android:textColorHint">@color/gray</item>
<item name="boxStrokeColor">@color/text_edit_layout_outline_color</item>
<item name="strokeWidth">2sp</item>
<item name="backgroundTint">@null</item>
<item name="boxCornerRadiusBottomEnd">7sp</item>
<item name="boxCornerRadiusBottomStart">7sp</item>
<item name="boxCornerRadiusTopEnd">7sp</item>
<item name="boxCornerRadiusTopStart">7sp</item>
</style>
<style name="grayEditText">
<item name="android:textColor">@color/gray_white</item>
<item name="android:textSize">14sp</item>
<item name="android:textCursorDrawable">@null</item>
<item name="android:layout_height">50sp</item>
<item name="android:gravity">bottom</item>
</style>
<style name="grayEditTextLayoutHelperText" parent="grayEditTextLayout">
<item name="android:layout_height">70sp</item>
</style>
question from:
https://stackoverflow.com/questions/65849253/edittext-gravity-affects-hint-text-but-not-input-text 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…