I am currently using FontAwesome in one of my Android projects. I primarily use it to display icons to the left of text on certain buttons. I noticed that since upgrading one of my test devices to Lollipop, the icons began sagging below the baseline of the text on the button. Please see the images below:
Please note that the bottom of the icon in the first image sits on the baseline of the text, while the bottom of the icon in the second image is below the baseline.
<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);
I am using the fa-sign-out icon. The code works fine on all devices running versions of Android prior to 5.0. Is there any way to fix this?
late but may help someone, Once resolved this issue using android:includeFontPadding="false"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With