-1
A
回答
0
您应该使用支持Android库为Tabs这一翻译第三方库。
activity_main.xml中
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabMode="fixed"
app:tabGravity="fill"/>
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
在代码中,你可以在一行代码设置选项卡
viewPager = (ViewPager) findViewById(R.id.viewpager);
setupViewPager(viewPager);
tabLayout = (TabLayout) findViewById(R.id.tabs);
tabLayout.setupWithViewPager(viewPager);
然后设置标签指示的高度为0,颜色tablayoutcolor,使他们消失
TabLayout.setSelectedTabIndicatorHeight(int height)
对于颜色:
TabLayout.setSelectedTabIndicatorColor(int color)
相关问题
- 1. 如何使用ViewPager删除TabPageIndicator标签
- 2. Android DatabaseHandler:删除一行
- 3. Android用光标删除行
- 4. 的Android删除换行符
- 5. Android Azure删除所有行
- 6. \ n(新行)删除的Android
- 7. 用最小的int SQL删除行mySQL
- 8. 在opencv中删除点和小行
- 9. 删除所有列小于25M的行
- 10. 与值删除行小于中的R
- 11. 多个小删除
- 12. 无法通过删除()删除SQLite数据库中的行 - Android
- 13. Android SparseArray删除
- 14. 删除Android库
- 15. 行删除后删除表
- 16. UISearchDisplayController删除行不删除
- 17. AsyncTask完成时加载TabPageIndicator
- 18. 删除和缩小ArrayList
- 19. Excel删除行删除错误的行
- 20. 在运行时删除Android ListView
- 21. Android AdapterList每行删除按钮
- 22. Android上的SQLite不删除行
- 23. 从android数据库中删除一行
- 24. 删除多行的sqlite的Android错误
- 25. 的Android的SQLite中删除一行
- 26. 从命令行删除Android SDK包
- 27. GridView行删除和动画 - Android
- 28. Android:如何删除行后刷新tablelayout?
- 29. 解析Android - 通过参数删除行
- 30. 删除表中的最后一行android
发表您的布局 – YUVRAJ
显示您的布局代码。 – Drv