Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k 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 Reply

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"

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.8k users

...