Первый ввод букв в EditText не полностью виден при использовании пользовательского шрифта в Android - PullRequest
0 голосов
/ 22 января 2020

Я не могу заставить мои первые буквы правильно отображаться при использовании пользовательского шрифта с EditText в Android Studio

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".MainActivity">


    <EditText
        android:id="@+id/editText"
        android:paddingLeft="20dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPersonName"
        android:fontFamily="@font/telly_humble"
        android:textSize="35dp"
        android:text="jay" />

</RelativeLayout>

example

Edit: забыл упомянуть, что я также пробовал padding-left или start, но у меня не получилось.

Мое окончательное решение - изменить шрифт.

Ответы [ 2 ]

0 голосов
/ 22 января 2020

Добавьте отступ слева и справа, это должно решить проблему

<EditText
    android:paddingLeft="40dp"
    android:paddingRight="40dp"
    android:id="@+id/editText"
    android:layout_marginLeft="30dp"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:inputType="textPersonName"
    android:fontFamily="@font/telly_humble"
    android:textSize="35dp"
    android:text="jay" />
0 голосов
/ 22 января 2020

Попробуйте добавить paddingLeft.

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout 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"
    tools:context=".MainActivity">


    <EditText
        android:id="@+id/editText"
        android:layout_marginLeft="30dp"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:inputType="textPersonName"
        android:fontFamily="@font/telly_humble"
        android:paddingLeft="10dp"
        android:textSize="35dp"
        android:text="jay" />

</RelativeLayout>
...