Android 吸顶布局

2020-10-22  本文已影响0人  雨来
<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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=".mainfragment.HallFragment">

       <com.google.android.material.appbar.AppBarLayout
           android:id="@+id/app_bar"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
           android:fitsSystemWindows="true"
           >
           <LinearLayout
               android:id="@+id/ll_zd_hall"
               android:layout_width="match_parent"
               android:layout_height="wrap_content"
               android:background="#ffaaee"
               android:orientation="vertical"
               app:layout_scrollFlags="scroll|exitUntilCollapsed">

               <RelativeLayout
                   android:background="#ff0000"
                   android:layout_marginLeft="19dp"
                   android:layout_marginRight="19dp"
                   android:layout_marginTop="13dp"
                   android:layout_width="match_parent"
                   android:layout_height="86dp"></RelativeLayout>

               <LinearLayout
                   android:layout_marginBottom="19dp"
                   android:layout_marginTop="19dp"
                   android:layout_marginLeft="19dp"
                   android:id="@+id/ll_search_home_fragment"
                   android:orientation="horizontal"
                   android:layout_marginRight="19dp"
                   android:layout_gravity="center_vertical"
                   android:background="@drawable/shape_border"
                   android:layout_width="match_parent"
                   android:layout_height="27dp"
                   >

                   <ImageView
                       android:src="@drawable/search"
                       android:layout_marginLeft="2dp"
                       android:layout_gravity="center_vertical"
                       android:layout_width="23dp"
                       android:layout_height="23dp"></ImageView>


                   <TextView
                       android:textColor="#8D8D8D"
                       android:gravity="center"
                       android:textSize="12sp"
                       android:text="课程、内容、师生"
                       android:layout_gravity="center_vertical"
                       android:layout_width="match_parent"
                       android:layout_height="wrap_content"></TextView>


               </LinearLayout>

               <LinearLayout
                   android:layout_marginLeft="19dp"
                   android:layout_marginRight="19dp"
                   android:layout_width="match_parent"
                   android:layout_height="wrap_content"
                   android:orientation="horizontal">

                   <TextView
                       android:id="@+id/tv_rs_left"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:text="热搜"
                       android:textColor="#333333"
                       android:textSize="12sp"></TextView>


                   <androidx.recyclerview.widget.RecyclerView
                       android:layout_marginLeft="10dp"
                       android:layout_width="match_parent"
                       android:layout_height="20dp"></androidx.recyclerview.widget.RecyclerView>
               </LinearLayout>

               <com.zhpan.bannerview.BannerViewPager
                   android:layout_marginLeft="19dp"
                   android:layout_marginRight="19dp"
                   android:layout_marginTop="20dp"
                   android:id="@+id/banner_view_hall"
                   android:layout_width="match_parent"
                   android:layout_height="129dp"
                   />


           </LinearLayout>
           <com.google.android.material.tabs.TabLayout
               android:id="@+id/tablayout_hall"
               android:layout_width="match_parent"
               android:layout_height="42dp"
               android:layout_marginTop="10dp"
               android:background="#ffffff"></com.google.android.material.tabs.TabLayout>



       </com.google.android.material.appbar.AppBarLayout>


    <androidx.viewpager2.widget.ViewPager2
        app:layout_behavior="@string/appbar_scrolling_view_behavior"
        android:background="#999999"
        android:id="@+id/vp2_hall"
        android:layout_width="match_parent"
        android:layout_height="match_parent"></androidx.viewpager2.widget.ViewPager2>






</androidx.coordinatorlayout.widget.CoordinatorLayout>
上一篇 下一篇

猜你喜欢

热点阅读