BVB*_*BVB 5 android textview android-layout font-awesome android-5.0-lollipop
我目前在我的一个Android项目中使用FontAwesome.我主要用它来显示某些按钮上文字左侧的图标.我注意到,自从将我的一个测试设备升级到Lollipop后,图标开始下降到按钮上文本的基线以下.请看下面的图片:
请注意,第一张图像中图标的底部位于文本的基线上,而第二张图像中图标的底部位于基线下方.
<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版本的所有设备.有没有什么办法解决这一问题?
归档时间: |
|
查看次数: |
1268 次 |
最近记录: |