第三方TabLayout的静态动态使用 和Viewpage一起使用
最新推荐文章于 2024-05-14 00:06:12 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
TabLayout有静态动态两种实现方法 并实现多个标题或控件实现滑动
废话不多说
直接上代码
布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="a16.erin.tablayout_demo.MainActivity">
<android.support.design.widget.TabLayout
android:id="@+id/mytag_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:tabSelectedTextColor=
04-24
3万+
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-13
5136
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-15
2671
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交
评论
![](https://csdnimg.cn/release/blogv2/dist/pc/img/closeBt.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/closeBt.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/commentArrowLeftWhite.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/iconPark.png)
查看更多评论
![](https://csdnimg.cn/release/blogv2/dist/pc/img/commentArrowDownWhite.png)
添加红包
![](https://csdnimg.cn/release/blogv2/dist/pc/img/guideRedReward02.png)
![](https://csdnimg.cn/release/blogv2/dist/pc/img/guideRedReward03.png)