Tiz*_*ica 5 android android-icons android-actionbar font-awesome
是否可以通过使用AwesomeFont的setIcon方法(接受drawable或Resource id)在ActionBar中设置Icon "Text"?
我应该创建一个Drawable或类似的东西吗?在Drawable中我应该创建什么?
编辑
public class AwesomeTextView extends TextView {
private static Typeface fontAwesome;
public AwesomeTextView(Context context, AttributeSet attrs) {
super(context, attrs);
if (fontAwesome == null) {
fontAwesome = Typeface.createFromAsset(context.getAssets(), "fonts/fontawesome-webfont.ttf");
}
setTypeface(fontAwesome);
}
}
Run Code Online (Sandbox Code Playgroud)
所以我创建了一个使用font-awesome的AwesomeTextView,有没有办法让AwesomeTextView成为可绘制的?
我做了一个回购,轻松地为你的android项目添加字体真棒图标
https://github.com/bperin/FontAwesomeAndroid
如果您尝试在操作栏中添加这些内容,则可能需要通过XML进行自定义布局
| 归档时间: |
|
| 查看次数: |
6037 次 |
| 最近记录: |