如何在android的提示文本中设置字母间距

问题描述 投票:0回答:1

我有一个编辑文本字段,我可以在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>
android android-layout android-intent android-edittext
1个回答
0
投票

这实际上可能会帮助您:setLetterSpacing()或与XML相关的属性android:letterSpacing

© www.soinside.com 2019 - 2024. All rights reserved.