Remove line break in TabLayout

后端 未结 8 1956
自闭症患者
自闭症患者 2020-11-27 05:30

I just added the new TabLayout component to my app. As you may know there are two different modes for tabs app:tabMode=\"scrollable\" and app:tabMode=\"fi

相关标签:
8条回答
  • 2020-11-27 06:03

    Showing "..." in tab titles will not make a good UI experience I suggest that you should set tabmode to scrollable and let tab titles take as much space they want.

      <android.support.design.widget.TabLayout
                    android:id="@+id/htab_tabs"
                    android:layout_width="wrap_content"
                    android:layout_height="?attr/actionBarSize"
                    android:layout_gravity="bottom"
                    app:tabIndicatorColor="@android:color/white"
                    app:tabMode="scrollable" />
    
    0 讨论(0)
  • 2020-11-27 06:04
    float myTabLayoutSize = 360;
    if (DeviceInfo.getWidthDP(this) >= myTabLayoutSize ){
        tabLayout.setTabMode(TabLayout.MODE_FIXED);
    } else {
        tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
    }
    
    0 讨论(0)
提交回复
热议问题