인프런 커뮤니티 질문&답변
listview. adapter 에 질문있습니다.
작성
·
228
퀴즈
What are the main performance advantages of RecyclerView compared to ListView?
Uses less memory.
Excellent scroll performance through view recycling.
Item click handling is simpler.
Data model connection is automatically established.
답변 1
0
개복치개발자
지식공유자
안녕하세요 처음 안드로이드를 할 때 ListView가 굉장히 헷갈립니다.
위의 코드에서 listview.adapter 부분은 xml파일의 listview에 adapter를 연결하겠다 라고 하는 것이고
연결할 어댑터가 위에 선언한 ListviewAdapter입니다.
그러면 listview에 adapter에 있는 데이터가 들어가야 하는데 그 데이터는
val listviewAdapter = ListviewAdapter(list_item)
이 부분에서 list_item 에 있는 데이터를 adapter로 넘겨주는 것입니다.
이해가 어려우시면 한번 더 문의주세요 :)





