【问题标题】:how can i customize an edittext? [duplicate]如何自定义编辑文本? [复制]
【发布时间】:2020-04-07 21:26:41
【问题描述】:
var tel_text = "Enter your phone number"

考虑edittext是带有大字体的tel_text。当用户开始在edittext中写这篇文章时,我希望它是从下到上的动画。如何最简单地自定义 Edittext?

【问题讨论】:

标签: android kotlin android-edittext


【解决方案1】:

您似乎想向它添加一个提示,当用户开始键入时,它会在顶部设置动画。将其包裹在 TextInputLayout 中

<android.support.design.widget.TextInputLayout
    android:id="@+id/edt_hint"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:hint="Enter your phone number">

    <EditText
        android:id="@+id/edit"
        android:layout_width="match_parent"
        android:layout_height="wrap_content" />


</android.support.design.widget.TextInputLayout>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-09-28
    • 1970-01-01
    • 2020-06-22
    • 1970-01-01
    • 2021-08-18
    • 1970-01-01
    • 1970-01-01
    • 2018-11-10
    相关资源
    最近更新 更多