<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="@dimen/textinput_container_height"
app:errorEnabled="true"
app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.ErrorStyle"
tools:hint="@string/ip_printers">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="-5dp"
app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.ErrorStyle"
tools:text="1234567890" />
</android.support.design.widget.TextInputLayout>
这是我的代码。如何删除填充到错误文本? img with error img with error
答案 0 :(得分:0)
您必须删除此行
android:layout_marginStart="-5dp"
或
如果您需要该保证金,请在parentView - android.support.design.widget.TextInputLayout
像
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="@dimen/textinput_container_height"
app:errorEnabled="true"
app:errorTextAppearance="@style/TextAppearance.AppCompat.Small.ErrorStyle"
tools:hint="@string/ip_printers"
android:layout_marginStart="-5dp">
答案 1 :(得分:0)
TextInputLayout
是LinearLayout
,因此您应该能够指定负边距或填充,例如。
android:layout_marginLeft="-2dp"
android:layout_marginStart="-2dp"