androidtextviewandroid-5.1.1-lollipop

Android Lollipop TextView: different vertical alignment of digits and letters


I have a TextView that should display formatted number and some letters.

   <android.support.v7.widget.AppCompatTextView
    android:id="@+id/balance"
    fontPath="@string/helvetica_neue_bold"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="14dp"
    android:ellipsize="end"
    android:gravity="center_horizontal"
    android:lines="1"
    android:textColor="@color/martinique"
    android:textSize="24sp"
    tools:text="1 23.01 USD" />

On the preview it's text is correctly centered:
preview

But on a device letters and digits have different alignment: on device

Why may it happen?


Solution

  • The font issue,you can change other one or default,and try again.if not you can change the ttf file in same fontstyle