最近正好有这个需求,于是整理了这个文档,希望对大家有所帮助:
这里有三个步骤即可完成非常简单,大家可以保存:
一:导入开源库
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
特简单吧!
二:建立三个碎片
这个就不用我教大家了吧,直接右键创建三个Fragment就可以了。
三:xml布局:这里是很关键的地方当然也很简单(咱们使用PagerSlidingStrip第三方开源):
<?xml version="1.0" encoding="utf-8"?> <android.support.v7.widget.LinearLayoutCompat xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_main" android:layout_width="match_parent" android:layout_heig