更改大小后如何在纯文本中显示文本?

问题描述 投票:0回答:2

我在更改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.。请帮忙。谢谢。

java android plaintext hint
2个回答
0
投票

设置android:layout_height="32dp"时,对于标准文字大小来说太小了。因此,转换为android:layout_height="wrapcontent"是理想的解决方案。

如果您确实必须保持32dp的高度,则应减小文本大小,以使其适合给定的32dp高度。

喜欢android:textSize="10dp"


0
投票

我不知道为什么,但是在添加背景android:background="#000000"之后看起来很完美。所以是解决方案

© www.soinside.com 2019 - 2024. All rights reserved.