Compose의 고급 레이아웃
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
레이아웃 단계 및 제약조건, 하위 Compose 레이아웃, 내부 측정에 중점을 두고 Compose 레이아웃의 복잡한 디자인을 빌드하는 방법을 알아보세요.
핵심사항
- 레이아웃 단계는 요소 크기 및 배치가 정의되는 Compose의 단계입니다.
- 레이아웃 단계에서 UI 트리의 각 요소는 하위 요소를 측정하여 상위 요소가 자체 크기를 결정하고 사용 가능한 2D 공간에 하위 요소를 배치할 수 있도록 합니다.
- 맞춤 레이아웃을 빌드하려면 컴포저블 콘텐츠를 하위 요소로 허용하는
Layout
컴포저블을 호출합니다.
- 하위 컴포지션을 사용하면 지연 컴포넌트가 스크롤하는 동안 주문형으로 콘텐츠를 추가할 수 있습니다.
- 하위 컴포지션된 레이아웃은 성능에 영향을 줄 수 있습니다. 하나 이상의 하위 요소의 컴포지션이 다른 하위 요소의 측정 결과에 종속되는 경우에 이 접근 방식을 사용하세요.
- 내장 측정을 사용하면 하위 요소가 측정되기 전에 하위 요소를 쿼리할 수 있습니다.
이 가이드가 포함된 컬렉션
이 가이드는 더 광범위한 Android 개발 목표를 다루는 선별된 빠른 가이드 모음의 일부입니다.
목록 또는 그리드 표시
목록과 그리드를 사용하면 앱에서 사용자가 쉽게 소비할 수 있는 시각적으로 만족스러운 형식으로 컬렉션을 표시할 수 있습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-02-06(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-02-06(UTC)"],[],[],null,["# Advanced layouts in Compose\n\n\u003cbr /\u003e\n\nSee how to build complex designs for your Compose layouts, focusing on layout\nphase and constraints, subcompose layouts, and intrinsic measurements. \n\nKey points\n----------\n\n- The *layout phase* is the phase of Compose where element sizing and positioning is defined.\n- During the layout phase, each element in the UI tree measures its children, enabling the parent to decide its own size and placing the children in the available 2D space.\n- To build a custom layout, call the [`Layout`](/reference/kotlin/androidx/compose/ui/layout/package-summary#Layout(kotlin.collections.List,androidx.compose.ui.Modifier,androidx.compose.ui.layout.MultiContentMeasurePolicy)) composable, which accepts the composable content as its children.\n- Subcomposition enables lazy components to add content on demand while scrolling.\n- Subcomposed layouts can have an impact on performance. Use this approach when at least one child's composition depends on the result of another child's measurement.\n- Intrinsic measurements let you query children before they're measured.\n\nCollections that contain this guide\n-----------------------------------\n\nThis guide is part of these curated Quick Guide collections that cover\nbroader Android development goals: \n\n### Display a list or grid\n\nLists and grids allow your app to display collections in a visually pleasing form that's easy for users to consume. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/display-a-list-or-grid) \n\nHave questions or feedback\n--------------------------\n\nGo to our frequently asked questions page and learn about quick guides or reach out and let us know your thoughts. \n[Go to FAQ](/quick-guides/faq) [Leave feedback](https://issuetracker.google.com/issues/new?component=1573691&template=1993320)"]]