Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

android - How do I reduce the padding between the text hint and text line?

I have a TextInputEditText with a hint shown. I really do not like the amount of space between the hint and text line. I have tried setting the gravity to bottom but no luck.

       <com.google.android.material.textfield.TextInputEditText
                    android:layout_width="400dp"
                    android:layout_height="wrap_content"
                    android:background="@android:color/white"
                    android:inputType="textNoSuggestions"
                    android:hint="@string/email_hint"
                    android:textColorHint="@color/color_hint_grey"
                    android:fontFamily="@font/alternate_got_no1d"
                    android:textSize="20sp"/>

enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

add this to your com.google.android.material.textfield.TextInputEditText:

                android:paddingStart="0dp"
                android:paddingLeft="0dp"
                android:paddingRight="0dp"
                android:paddingEnd="0dp"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...