多行内的EditText暗示的定位 - TextInputLayout [英] Positioning hint within multiline EditText - TextInputLayout

查看:367
本文介绍了多行内的EditText暗示的定位 - TextInputLayout的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个的EditText 有4条线(分= 4;> 4卷轴)。在的EditText 嵌入在 TextInputLayout 。此显示的提示似乎垂直居中。我想它在第1行的开始,自然。

I have an EditText that has 4 lines (min=4; >4 scrolls). The EditText is embedded in a TextInputLayout. The hint displayed for this seems to be centered vertically. I'd like it at the start of the 1st line, naturally.

重要修改:不带 TextInputLayout 测试允许提示进行有效定位。问题在于这一点。任何深入了解如何解决它AP preciated。

Important Edit: Testing without TextInputLayout allows for the hint to be positioned effectively. The problem lies with this. Any insight into how to resolve it is appreciated.

<android.support.design.widget.TextInputLayout
    android:id="@+id/text_input_layout"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:focusableInTouchMode="true">

    <EditText
        android:id="@+id/status"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:ems="10"
        android:fadeScrollbars="false"
        android:gravity="left"
        android:hint="What's going on?"
        android:inputType="textMultiLine"
        android:lines="4"
        android:minLines="4"
        android:scrollbarStyle="outsideInset"
        android:scrollbarThumbVertical="@drawable/custom_scrollbar_style"
        android:scrollbars="vertical"
        android:textColorHint="@color/black_semi_transparent" />

    <TextView
        android:id="@+id/text_count"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:ems="10"
        android:text="140"
        android:textColor="@color/black_semi_transparent" />

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

推荐答案

此bug已修复在V23支持库:

This bug has been fixed in the v23 support libraries:

HTTPS://$c$c.google。 COM / p /安卓/问题/细节?ID = 179720

这篇关于多行内的EditText暗示的定位 - TextInputLayout的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆