Skip to content

Feat/week2#18

Open
charlesahn0903 wants to merge 3 commits intoApptiveDev:안진형from
charlesahn0903:feat/week2
Open

Feat/week2#18
charlesahn0903 wants to merge 3 commits intoApptiveDev:안진형from
charlesahn0903:feat/week2

Conversation

@charlesahn0903
Copy link
Copy Markdown

week2 과제: SNS 피드 UI 구현

Copy link
Copy Markdown
Collaborator

@yeochaeeon yeochaeeon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다, 오늘 스터디 때 뵐게요~~

.fillMaxSize()
.padding(innerPadding)
) {
FeedCard(post)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

지금은 하나의 피드 카드만 떠있지만, 인스타 처럼 이 카드의 수가 10개, 100개로 늘어난다면 'LazyColumn'을 사용하는 편이 좋습니다.

일반 Column은 항목이 100개라면 화면에 보이지 않더라도 100개를 한꺼번에 다 그리지만 LazyColumn은 이름처럼 '게으르게' 작동해서, 지금 화면에 보이는 5~6개만 딱 그리고 나머지는 메모리에서 아낍니다.

  1. 여러 카드를 띄우려면 여러 PostData객체가 필요하니 PostData를 여러 개 담은 List를 먼저 만들고 (보통은 서버에서 가져올테지만 지금은 데이터가 없으니 임의로 만듭니다)
  2. LazyColumn 내부에서 items(리스트)를 호출해서 리스트 개수만큼 FeedCard를 반복 생성

이런 방향으로 직접 구현해봐도 좋을 것 같습니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants