Removing TextInputLayout extra top padding

*爱你&永不变心* 提交于 2019-12-05 07:46:10
Rajesh Peram

You can remove extra space above AppCompatEditText by setting app:hintEnabled="false" to TextInputLayout but it won't display hint until you re-enable that.

For more info goto Android Developer site -TextInputLayout

Checkout below code

<android.support.design.widget.TextInputLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    app:hintEnabled="false">

    <android.support.v7.widget.AppCompatEditText
        android:id="@+id/txt_amount"
        style="@style/EditTextStyle"
        android:hint="@string/hint_amount"
        android:inputType="numberDecimal"/>
</android.support.design.widget.TextInputLayout>

Hope this helpfull..

@Rajesh

You can use this

  <android.support.design.widget.TextInputLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:textColorHint="@android:color/white">

            <com.bugle.customviews.RobotoLightEditText

                android:id="@+id/edtName"
                style="@style/StyledTilEditText"
                android:hint="@string/name"
                android:imeOptions="actionNext"
                android:inputType="textCapWords" />

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

Add this line in EditText

android:translationY="-10dp"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!