-
Notifications
You must be signed in to change notification settings - Fork 5
5.9. 마이페이지
Seulgi Kim edited this page Jan 15, 2021
·
2 revisions
(1) RecyclerView를 통해 키워드 Display
- RecyclerView.Adapter를 상속받은 MyPageKeywordAdapter를 사용
- fragment_my_page.xml
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/rv_my_keyword"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="20dp"
tools:listitem="@layout/item_my_page_keyword_list"
tools:itemCount="4"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_my_keyword" />
- MyPageFragment.kt
private fun initRecyclerView() {
binding.rvMyKeyword.apply {
adapter = myPageKeywordAdapter
layoutManager = LinearLayoutManager(context)
setHasFixedSize(true)
}
}