gpt4 book ai didi

android - 如何在多行中获取 Textinputlayout 提示 android?

转载 作者:塔克拉玛干 更新时间:2023-11-02 08:34:21 24 4
gpt4 key购买 nike

我尝试了很多在线可用的选项,但它们似乎都不起作用。

我为此目的使用了这个 XML。

<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:hintTextAppearance="@style/TextLabel">

<com.projects.fonts.RobotoEditText
style="@style/EditText"
android:hint="@string/description"
android:singleLine="false"
app:font="@string/roboto_regular" />

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

我也设置了

<item name="android:singleLine">false</item>

在 TextLabel 和 EditText 中。但它们都不起作用。

最佳答案

你不能。

TextInputLayout 使用 CollapsingTextLayout 将提示测量为 CharSequence:

mTextPaint.measureText(mTextToDraw, 0, mTextToDraw.length())

CharSequence 没有行的概念,因此您不能添加更多。


如果它这么长就不是什么提示了。如果您仍想显示它,请考虑在下方/上方/上方添加一个单独的 TextView 并为其设置动画(如果需要/需要)。

关于android - 如何在多行中获取 Textinputlayout 提示 android?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38433838/

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