gpt4 book ai didi

android - 为什么 float 提示动画不起作用?

转载 作者:行者123 更新时间:2023-11-29 00:53:24 25 4
gpt4 key购买 nike

我首先需要这样的动画:

enter image description here

(来自 Internet 的 Gif)但是即使使用 app:hintAnimationEnabled="true" 动画也不起作用。始终是 gif 的第二个示例。可能是什么问题呢?我做错了什么?

<com.google.android.material.textfield.TextInputLayout
android:id="@+id/textInputLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Login"
app:hintEnabled="true"
app:hintAnimationEnabled="true">

<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content" />

</com.google.android.material.textfield.TextInputLayout>

最佳答案

您还需要为 TextInputLayout 设置提示才能使动画正常工作,我只尝试动态设置提示按预期工作,请先尝试在 xml 中设置提示以查看它是否有效,如果没有则执行它是动态的:

TextInputLayout inputLayout = findViewById(R.id.textInputLayout);
inoutLayout.setHint("Hint");

关于android - 为什么 float 提示动画不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57345776/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com