我在更改Android Studio中纯文本的大小时遇到问题。这是窗口的默认大小,看起来很完美。
<EditText
android:id="@+id/editText3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="96dp"
android:layout_marginLeft="96dp"
android:layout_marginTop="588dp"
android:ems="10"
android:hint="E-mail"
android:inputType="textPersonName"
android:textColorHint="#F8F8F8"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
但是更改了这些值android:layout_width="196dp"
和android:layout_height="32dp"
后,提示的顶部被切成两半。像这个screenshot.。请帮忙。谢谢。
设置android:layout_height="32dp"
时,对于标准文字大小来说太小了。因此,转换为android:layout_height="wrapcontent"
是理想的解决方案。
如果您确实必须保持32dp的高度,则应减小文本大小,以使其适合给定的32dp高度。
喜欢android:textSize="10dp"
我不知道为什么,但是在添加背景android:background="#000000"
之后看起来很完美。所以是解决方案