-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Description
Overview
Context, problem or idea, solution or next step
Since 24.2.0, there is no way to align the baseline of the EditText surrounded by a TextInputLayout with the baseline of another component. I believe there are many situations where baseline alignment is required, such as showing an icon on the left of the input field, showing a unit label on the right of the field, and so on.
I am wondering if TextInputLayout could return the baseline position of its child with the getBaseline()
method, the behaviour would be consistent and it would be helpful to many developers.
Thanks.
Screenshots/Video (if possible)
N/A
Stack trace (if possible)
N/A
Reproduction steps
In the below layout, @id/my_edit_text
and @id/my_unit_label
are not aligned on their baseline.
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<android.support.design.widget.TextInputLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1">
<android.support.design.widget.TextInputEditText
android:id="@+id/my_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="text" />
</android.support.design.widget.TextInputLayout>
<TextView
android:id="@+id/my_unit_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/unit_label"/>
</LinearLayout>
Version number
25.1.0
Operating system and device
All Android OS and Android devices
Related issues
VeneetReddyK, Sevastyan, piospy, gaborbiro, DJPretorius and 1 more
Metadata
Metadata
Assignees
Labels
No labels