一、实现效果:
二、依赖jar包:
compile 'com.android.support:design:24+'
三、项目工程结构:
四、XML布局
activity_main.xml布局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<Button
android:id="@+id/title_button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="微信" />
<android.support.v4.view.ViewPager
android:id="@+id/viewpager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"></android.support.v4.view.