不幸的是other question wasn't answered关于如何隐藏android.support.design.widget.TabLayout中的标签。 其他问题与TabHost,我不想改变我的代码。Tablayout中隐藏标签Android
我想隐藏标签“三”。
片段:
viewPager = (ViewPager) rootView.findViewById(R.id.search_viewPager);
viewPager.addOnPageChangeListener(viewPagerListener);
viewPager.setAdapter(adapter);
tabLayout = (TabLayout) rootView.findViewById(R.id.search_tabs);
tabLayout.setTabGravity(TabLayout.GRAVITY_FILL);
tabLayout.setupWithViewPager(viewPager);
布局:
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
android:id="@+id/search_tabs"
style="@style/TabLayoutStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:elevation="1dp" />
android:id="@+id/search_viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true" />
+1
你可以将自己看着,并解释为什么该解决方案没有为你工作的其他问题?这是一个重复的问题,或者需要更多的解释来调整。 –
+1
请分享源码 –
+1
请不要在没有适用的代码 –