-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);
真的很感謝它的工作正常。 –
你可以發佈你的代碼嗎? –