0

我下面這個tutorial和我在CustomViewIconTextTabsActivity改變setupTabIcons的代碼:標籤標題沒有完全示出的材料設計庫

private void setupTabIcons() { 
    TextView tabOne = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null); 
    tabOne.setText("PROPOSAL"); 
    tabOne.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_tab_favourite, 0, 0); 
    tabLayout.getTabAt(0).setCustomView(tabOne); 

    TextView tabTwo = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null); 
    tabTwo.setText("MY JOBS"); 
    tabTwo.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_tab_call, 0, 0); 
    tabLayout.getTabAt(1).setCustomView(tabTwo); 

    TextView tabThree = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null); 
    tabThree.setText("MESSAGE"); 
    tabThree.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_tab_contacts, 0, 0); 
    tabLayout.getTabAt(2).setCustomView(tabThree); 

    TextView tabFour = (TextView) LayoutInflater.from(this).inflate(R.layout.custom_tab, null); 
    tabFour.setText("PROFILE"); 
    tabFour.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.ic_tab_contacts, 0, 0); 
    tabLayout.getTabAt(3).setCustomView(tabFour); 
} 

提案並未顯示completely..it被示出在第一個選項卡

PROPOSA

我嘗試增加和減少文本視圖的文本大小...如何顯示標籤中的完整文本?

回答

0

打開activity_custom_view_icon_text_tabs.xml和改變TabLayoutscrollabletabMode

<android.support.design.widget.TabLayout 
    android:id="@+id/tabs" 
    android:layout_width="match_parent" 
    android:layout_height="@dimen/custom_tab_layout_height" 
    app:tabMode="scrollable" 
    app:tabGravity="fill"/> 
+0

感謝.....它現在正 –