没有合适的资源?快使用搜索试试~ 我知道了~
Android中TabLayout结合ViewPager实现页面切换效果
2 下载量 66 浏览量
2021-01-20
10:13:50
上传
评论
收藏 58KB PDF 举报
温馨提示
试读
3页
先看看效果,如图: 1.因为TabLayout是Android Design Support Library官方库的一个控件,所以使用TabLayout时候需要先添加对该库的依赖 compile ‘com.android.support:design:22.2.0’ 2.下面是TabLayout和ViewPager配合使用的布局 <?xml version=1.0 encoding=utf-8?> <RelativeLayout xmlns:android=http://schemas.android.com/apk/res/android xmlns:app=htt
资源详情
资源评论
资源推荐
Android中中TabLayout结合结合ViewPager实现页面切换效果实现页面切换效果
先看看效果,如图:
1.因为TabLayout是Android Design Support Library官方库的一个控件,所以使用TabLayout时候需要先添加对该库的依赖
compile ‘com.android.support:design:22.2.0’
2.下面是TabLayout和ViewPager配合使用的布局
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.cxk.myapplication.MainActivity">
<android.support.design.widget.TabLayout
android:id="@+id/tablayout"
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="#1FBCD2"
app:tabTextAppearance="@style/MyTabLayoutTextAppearance"
app:tabIndicatorColor="@color/white"
app:tabSelectedTextColor="@color/white"
app:tabTextColor="@color/ripple_material_dark"
app:tabIndicatorHeight="2dp" />
<android.support.v4.view.ViewPager
weixin_38666785
- 粉丝: 4
- 资源: 958
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0