Compose の遅延リスト
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Compose では、RecyclerView
よりも少ないコード行数で、スクロール リストをよりシンプルかつ高パフォーマンスで作成できます。遅延レイアウトを使用して、コンテンツをオンデマンドでリストに追加できるリストを作成する方法について学びます。
要点
- 遅延レイアウトを使用して、大量のアイテムや大規模なデータセットにコンテンツをオンデマンドで追加し、アプリのパフォーマンスと応答性を向上させます。
- このアプローチでは、アイテム コンテンツの記述に集中し、残りの処理は遅延リストに任せることができます。
- 1 つのアイテムを記述するには
item()
ブロックを使用し、複数のアイテムを記述するには items()
ブロックを使用します。
LazyListState
は、スクロール位置を保存し、リストに関する有用な情報を含んでいる重要な状態オブジェクトです。
リソース
このガイドを含むコレクション
このガイドは、Android 開発の幅広い目標を網羅する、厳選されたクイックガイド コレクションの一部です。
リストまたはグリッドを表示する
リストとグリッドを使用すると、アプリでコレクションを視覚的に魅力的でユーザーが使いやすい形式で表示できます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 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-07-27 UTC。"],[],[],null,["# Lazy lists in Compose\n\n\u003cbr /\u003e\n\nCompose gives you a simpler and more performant way to create scrolling lists,\nusing fewer lines of code than [`RecyclerView`](/reference/androidx/recyclerview/widget/RecyclerView). Learn how to use lazy\nlayouts to create lists that let you add content to lists, on demand. \n\nKey points\n----------\n\n- Use lazy layouts to add content on demand for a significant number of items or large datasets, increasing your app's performance and responsiveness.\n- This approach lets you focus on describing your item content while lazy lists handle everything else.\n- You can describe one item using the [`item()`](/reference/kotlin/androidx/compose/foundation/lazy/LazyListScope#item(kotlin.Any,kotlin.Any,kotlin.Function1)) block or multiple items with the [`items()`](/reference/kotlin/androidx/compose/foundation/lazy/LazyListScope#items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function2)) block.\n- [`LazyListState`](/reference/kotlin/androidx/compose/foundation/lazy/LazyListState) is an important state object that stores the scroll position and contains useful information on your list.\n\nResources\n---------\n\n- [Codelab: Basic layouts in Compose](/codelabs/jetpack-compose-layouts#0)\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)"]]