项目地址:https://code.aliyun.com/873044564/foodie/tree/master
这里面使用了ScrollableLayout ,Banner ,TabLayout,ViewPager,ListView 这四个整体实现了一个常见的效果;
其中Banner可以看我的另一篇文章https://blog.csdn.net/qq873044564/article/details/81262512
<?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"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.cpoopc.scrollablelayoutlib.ScrollableLayout
android:id="@+id/scrollLayout_main"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.youth.banner.Banner
android:id="@+id/banner_fg_main"
android:layout_width="match_parent"
android:layout_height="200dp" />
<com.google.android.material.tabs.TabLayout
android:id="@+id/tab_fg_main"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:tabIndicatorColor="@color/colorPrimary" />
<LinearLayout