首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >标签标题在材料设计库中没有完全显示。

标签标题在材料设计库中没有完全显示。
EN

Stack Overflow用户
提问于 2015-11-04 07:24:10
回答 2查看 725关注 0票数 0

我遵循这个教程,并在CustomViewIconTextTabsActivity中更改了setupTabIcons的代码

代码语言:javascript
复制
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在第一个选项卡上显示提议

我试图增加和缩小文本视图的文本大小.如何在选项卡中显示完整的文本?

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2015-11-04 10:44:17

打开activity_custom_view_icon_text_tabs.xml并将TabLayouttabMode更改为scrollable

代码语言:javascript
复制
<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
EN

Stack Overflow用户

发布于 2019-02-15 17:45:18

我发现了两种方法

第一个是

代码语言:javascript
复制
app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"

将此用作主题,如

代码语言:javascript
复制
   <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabMode="fixed"
        app:tabTextAppearance="@android:style/TextAppearance.Widget.TabWidget"
        app:tabGravity="fill"/>

第二:使用app:tabMode="scrollable"

代码语言:javascript
复制
 <android.support.design.widget.TabLayout
        android:id="@+id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        app:tabMode="scrollable"
         app:tabGravity="fill"/>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33515963

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档