2017-10-05 6 views

Répondre

1

Créer une mise en page XML nommé custom_tab.xml

custom_tab.xml

<?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" 
    /> 

font maintenant un ensemble de mise en page d'onglet à l'aide du code ci-dessous

TextView tabOne = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null); 
tabOne.setText("&#xf1fe;"); 
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/fontawesome-webfont.ttf"); 
tabOne.setTypeface(typeface); 
tabLayout.getTabAt(0).setCustomView(tabOne); 

How to Use FontAwesome in an Android App

+1

vraiment merci son fonctionnement bien. –