本篇效果图:
新增效果
(不同于本篇效果的另一种效果,包含在本项目中):
第一张图 通过RecyclerView+Vlayout
多布局实现;第二张具有实战性质的效果图 通过CoordinatorLayout+RecyclerView
实现;
第一版得布局结构图:
起初考虑到TabLayout
和RecyclerView
(ViewPager中)可以一起滑动,所以很容易想到的办法就是用Scrollview
将两者嵌套进去,效果是实现了,但是Scrollview
嵌套Viewpager
的弊端显而易见!
而第二版即本篇博客并不是为了解决Scrollview
嵌套Viewpager的问题,而是换一种思路去实现!
布局结构图,很简单,就两层:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f7f7f7"
android:focusable="true"
android:focusableInTouchMode="true">
<LinearLayout
android:id="@+id/ll_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<net.lucode.hackware.magicindicator.MagicIndicator
android:id="@&#