作者热门文章
- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我尝试了很多在线可用的选项,但它们似乎都不起作用。
我为此目的使用了这个 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/
我是一名优秀的程序员,十分优秀!