繁体   English   中英

更改大小后如何使纯文本中的文本可见?

[英]How to make text visible in Plain Text after changing its size?

我在 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"提示顶部被切成两半。 就像这个截图一样。 . 请帮忙。 谢谢。

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

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

就像那个android:textSize="10dp"

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM