我有一个编辑文本字段,我可以在edittext普通文本中设置字母间距,但是该字母间距不会影响提示文本。
<android.support.design.widget.TextInputLayout
android:id="@+id/etEmailLayout"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:theme="@style/TextInputLayoutAppearance"
app:hintTextAppearance="@style/HintText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/etLastNameLayout">
<EditText
android:id="@+id/etEmail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="EMAIL ADDRESS"
android:inputType="textEmailAddress"
android:paddingBottom="16dp"
android:singleLine="true"
android:textColor="@color/white"
android:textSize="16dp"
android:textStyle="bold"
app:backgroundTint="@color/white20"
android:paddingStart="20dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
tools:layout_editor_absoluteY="197dp" />
</android.support.design.widget.TextInputLayout>
这是我的style.xml文件
<style name="TextInputLayoutAppearance" parent="Widget.Design.TextInputLayout">
<!-- reference our hint & error styles -->
<item name="hintTextAppearance">@style/HintText</item>
<item name="errorTextAppearance">@style/ErrorText</item>
<item name="android:textColor">@color/white</item>
<item name="android:textColorHint">@color/white</item>
<item name="colorControlNormal">@color/white</item>
<item name="colorControlActivated">@color/white</item>
<item name="colorControlHighlight">@color/white</item>
</style>
这实际上可能会帮助您:setLetterSpacing()或与XML相关的属性android:letterSpacing