删除AutoCompleteTextView左填充

时间:2018-07-09 15:44:26

标签: android

我想删除AutoCompleteTextView的左填充,所以我在xml中将填充设置为0:

<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    tools:context=".MainActivity"
    tools:showIn="@layout/activity_main">

    <TextView
        android:id="@+id/hello_text_view"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        app:layout_constraintBottom_toBottomOf="@+id/auto"
        android:paddingEnd="10dp"/>

    <AutoCompleteTextView
        android:id="@+id/auto"
        android:layout_width="200dp"
        android:layout_height="wrap_content"
        app:layout_constraintLeft_toRightOf="@+id/hello_text_view"
        android:paddingStart="0dp"/>

</android.support.constraint.ConstraintLayout>

但是结果很丑陋,我希望下划线从EditText的开头开始

enter image description here

1 个答案:

答案 0 :(得分:0)

如果您将android:paddingStart =“ 4dp”设置为0dp,则效果会更好 enter image description here