프레임레이아웃이 화면의 상, 하에 있는 앱바들을 사진처럼 찍어내어, 리사이클러뷰의 아이템 항목에
넣어서 아이템들과 함께 출력시켜줍니다.
쉽게 말해서, 한 화면안에 있는 모든 출력물들을 사진 찍듯이 리사이클러뷰 항목 1개에
이 화면을 그대로 찍어넣어서 출력시켜줍니다.
리사이클러뷰 항목 갯수가 140개인데, 화면을 140개 복제하여, 항목에 들어가는 아이템과 함께 출력됩니다.
스크롤을 시작하면, 140개의 아주 긴~~~ 화면이 출력됩니다... 뷰홀더 클래스나 어댑터를 잘못 설정한게 아닙니다.
오로지 태그에서 잘못된것 같습니다.
<LinearLayout 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"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
android:orientation="vertical"
tools:context="com.example.yhw.TestActivity"
tools:showIn="@layout/activity_test">
<androidx.coordinatorlayout.widget.CoordinatorLayout
android:id="@+id/coordinator1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.AppBarLayout
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="@color/white">
<LinearLayout
android:id="@+id/linear1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_scrollFlags="scroll|enterAlways"
android:orientation="horizontal">
<TextView
android:id="@+id/download"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="3dp"
android:layout_gravity="center"
android:layout_weight="1"
android:drawableTop="@drawable/drawable_download"
android:text="다운"
android:textSize="14dp"
android:gravity="center"/>
<TextView
android:id="@+id/title2"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_gravity="center"
android:text="예레미야3장27절"
android:textSize="25dp"
android:gravity="center"
android:layout_weight="3" />
<TextView
android:id="@+id/menu"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginTop="4dp"
android:drawableTop="@drawable/drawable_menu"
android:layout_weight="1"
android:text="메뉴"
android:textSize="14dp"
android:gravity="center"/>
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#f0f0f0"/>
<!-- width와 hieght를 match로 해줘야 리사이클러뷰가 스크롤 가능해진다. -->
<FrameLayout
android:id="@+id/fragmentBorC"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true">
<TextView
android:id="@+id/IntText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
tools:text="This is some temp text" />
</FrameLayout>
<!-- layout_weight는 사용하면 안된다. 상하단바 스크롤 기능이 사라진다. -->
<!-- ★리사이클러뷰의 내용물을 상단바 바로 밑에서부터 시작되게 코딩해놓자.★ -->
<com.google.android.material.bottomnavigation.BottomNavigationView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/reduce2"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="3dp"
android:layout_weight="1"
android:drawableTop="@drawable/drawable_reduce"
android:gravity="bottom|center"
android:text="축소"
android:textSize="14dp" />
<!-- 이거는 화면을 전환시키자. 그래서 선택된 절들을 저장시키고, 답을 찾았을때 연결시키자 -->
<TextView
android:id="@+id/search2"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="3dp"
android:layout_weight="1"
android:drawableTop="@drawable/drawable_search"
android:gravity="bottom|center"
android:text="검색"
android:textSize="14dp" />
<TextView
android:id="@+id/reading2"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="3dp"
android:layout_weight="1"
android:drawableTop="@drawable/drawable_reading"
android:gravity="bottom|center"
android:text="말씀"
android:textSize="14dp" />
<TextView
android:id="@+id/home2"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="3dp"
android:layout_weight="1"
android:clickable="true"
android:drawableTop="@drawable/drawable_home"
android:gravity="bottom|center"
android:text="집"
android:textSize="14dp" />
<TextView
android:id="@+id/question2"
android:layout_width="match_parent"
android:layout_height="52dp"
android:layout_marginTop="3dp"
android:layout_weight="1"
android:clickable="true"
android:drawableTop="@drawable/drawable_question"
android:gravity="bottom|center"
android:text="질문"
android:textSize="14dp" />
</LinearLayout>
</com.google.android.material.bottomnavigation.BottomNavigationView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>