-7
我是一个初学者在android.I使用字体真棒图书馆的图标。我想设置使用视图寻呼机如何设置tablayout图标使用fontawesome
我是一个初学者在android.I使用字体真棒图书馆的图标。我想设置使用视图寻呼机如何设置tablayout图标使用fontawesome
使用字体真棒在tablyout图标创建
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/tab"
/>
标签布局现在设置字体使用下面的代码custom_tab.xml
custom_tab.xml命名的XML布局
TextView tabOne = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null);
tabOne.setText("");
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/fontawesome-webfont.ttf");
tabOne.setTypeface(typeface);
tabLayout.getTabAt(0).setCustomView(tabOne);
真的很感谢它的工作正常。 –
你可以发布你的代码吗? –