在使用自定义图标字体时,如何在Android Lollipop中修复字体基线?

BVB*_*BVB 5 android textview android-layout font-awesome android-5.0-lollipop

我目前在我的一个Android项目中使用FontAwesome.我主要用它来显示某些按钮上文字左侧的图标.我注意到,自从将我的一个测试设备升级到Lollipop后,图标开始下降到按钮上文本的基线以下.请看下面的图片:

Android KitKat(Nexus 7) - 好:

奇巧

Android Lollipop(Nexus 4) - 糟糕:

棒糖

请注意,第一张图像中图标的底部位于文本的基线上,而第二张图像中图标的底部位于基线下方.

码:

<string name="button_text_logout">? LOG OUT</string>

<TextView
    android:layout_width="wrap_content"
    android:layout_height="match_parent"
    android:textSize="@dimen/text_size_menu_item"
    android:textColor="@color/white"
    android:gravity="center_vertical"
    android:text="@string/button_text_logout"
    android:paddingLeft="@dimen/action_item_padding"
    android:paddingRight="@dimen/action_item_padding"/>

Typeface typeface = Typeface.createFromAsset(context.getAssets(), "fontawesome-webfont.ttf");
logOutTextView.setTypeface(typeface);
Run Code Online (Sandbox Code Playgroud)

我正在使用fa-sign-out图标.该代码适用于运行5.0之前的Android版本的所有设备.有没有什么办法解决这一问题?

QAM*_*MAR 3

迟到但可能会帮助别人,一旦使用解决了这个问题android:includeFontPadding="false"