RecyclerView 생성 관련 질문 있습니다.
215
작성한 질문수 4
RecyclerView 를 만들어 , 아이템목록을 HomeFragment 화면에 띄우게 하려면, 어떻게 해야할까요?
HomeFragment.xml에 recyclerview 를 추가하고 , ContentListActivity의 내용을 HomeFragment에 옮기고 , Adapter 연결또한 HomeFragment 와 연결해주면 가능한가요? 직접 해보니 잘 안돼서 질문드립니다.
답변 1
0
말씀주신 것 처럼 시도해보셔도 좋을 것 같은데
혹시 시도를 해보셨나요?
만약 시도를 해보시고, 잘 안되시면 시도하신 방법과 코드를 함께 첨부해주시면 좀 더 도움드리기 좋을 것 같습니다~
0
개복치개발자님! 이렇게 시도해서 성공을 했는데, 여러개의 아이템을 넣어서 실행시켜보니, 스크롤시에 아이템이 하단바를 덮어쓴채로 스크롤이 되어 문제가 발생합니다. 리싸이클러뷰의 항목들만 스크롤을 하게 하려면 어떻게 수정해야할까요? 아래 그림처럼 나옵니다.

FragementHome.xml
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".fragments.HomeFragment">
<!-- TODO: Update blank fragment layout -->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="80dp"></androidx.recyclerview.widget.RecyclerView>
<LinearLayout
android:id="@+id/linearLayout2"
android:layout_width="match_parent"
android:layout_height="60dp"
app:layout_constraintBottom_toBottomOf="parent">
<ImageView
android:id="@+id/hometab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/sell_list"></ImageView>
<ImageView
android:id="@+id/chattab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/chat_img"></ImageView>
<ImageView
android:id="@+id/settingstab"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:src="@drawable/settings"></ImageView>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
</layout>
이미지가 기본이미지인지 확인
0
132
1
NavController error 발생
0
140
1
fragment 생성하고 메인에서 불러왔는데 안뜹니다.
0
140
2
67강 댓글
0
96
2
7강 데이터바인딩 에러
0
113
2
Firebase 스토리지 유료화 문제
1
295
2
게시글 이미지가 파이어베이스에 저장되지 않습니다.
0
180
2
AVD 갤러리에 이미지 저장 안되는 문제
0
238
2
이미지 받아오는 방법?
0
203
2
회원탈퇴 기능을 추가하려고 합니다.
0
186
2
상태바 질문 드립니다.
0
110
1
섹션2 인트로 페이지 꾸미기 질문 드립니다.
0
109
1
게시판 글을 길게 쓸경우
0
123
2
로그인 로그아웃
0
176
2
갤럭시 연결시 게시판에 업로드한 사진이 보이지 않아요.
0
205
2
웹뷰 AVD 실행안됨
0
190
1
자막켜기가 안되요 ㅜ.ㅜ
1
185
1
리사이클러뷰, 그리드레이아웃 오류
0
185
2
리사이클러뷰 오류 해결 방법이 궁금합니다.
0
194
1
firebase 스마트폰으로 연결이 안되는데 원인이 있을까요
0
257
2
안드로이드 스튜디오 게시글 이미지 업로드 유무
0
217
1
firebase 설정 오류
0
303
2
홈 화면 커뮤니티
0
178
1
게시판 글 읽기
0
239
2





