רשימות ב-Compose
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מרכיבים עצלים ב-Compose שמאפשרים להציג בקלות רשימות של פריטים.
איך מציגים סוגים שונים של פריטים, מטמיעים כותרות מוצמדות ומגיבים לשינויים במיקום הגלילה באופן פרוגרמטי.
נקודות עיקריות
- ממשק ה-API של
LazyColumn
נבנה כ-DSL, בניגוד לפריסות אחרות ב-Compose.
- משתמשים ב-
LazyColumn
כדי להציג פריטים שגלויים במסך.
- משתמשים בפונקציה
items()
כדי להעביר פריטים. פונקציית הלוגריתם מגדירה את התוכן של כל אחד מהפריטים, כך שתוכלו לשמור את הקוד הקיים.
- כדי להציג סוגים רבים של פריטים, משתמשים בפונקציה
groupBy
.
אוספים שמכילים את המדריך הזה
המדריך הזה הוא חלק מהאוספים הבאים של מדריכים מהירים, שמכסים יעדים רחבים יותר לפיתוח Android:
הצגת רשימה או רשת
רשימות ורשתות מאפשרות להציג באפליקציה קולקציות בצורה חזותית נעימה וקלה לשימוש למשתמשים.
יסודות הכתיבה (אוסף סרטונים)
בסדרת הסרטונים הזו נסביר על ממשקי API שונים של Compose, ונראה במהירות מה זמין ואיך משתמשים בהם.
דוגמאות התוכן והקוד שבדף הזה כפופות לרישיונות המפורטים בקטע רישיון לתוכן. Java ו-OpenJDK הם סימנים מסחריים או סימנים מסחריים רשומים של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-27 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-27 (שעון UTC)."],[],[],null,["# Lists in Compose\n\n\u003cbr /\u003e\n\nExplore Compose's lazy components, which make it easy to display lists of items.\nLearn how to show different item types, implement sticky headers, and\nprogrammatically control or react to the scroll-position changes. \n\nKey points\n----------\n\n- The [`LazyColumn`](/reference/kotlin/androidx/compose/foundation/lazy/package-summary#LazyColumn(androidx.compose.ui.Modifier,androidx.compose.foundation.lazy.LazyListState,androidx.compose.foundation.layout.PaddingValues,kotlin.Boolean,androidx.compose.foundation.layout.Arrangement.Vertical,androidx.compose.ui.Alignment.Horizontal,androidx.compose.foundation.gestures.FlingBehavior,kotlin.Boolean,kotlin.Function1)) API is built as a DSL, differing from other layouts in Compose.\n- Use `LazyColumn` to display items visible on screen.\n- Use the [`items()`](/reference/kotlin/androidx/compose/foundation/lazy/LazyListScope#items(kotlin.Int,kotlin.Function1,kotlin.Function1,kotlin.Function2)) function to pass items. The lambda defines the content of each of the items, so you can keep the existing code.\n- To display many different item types, use the `groupBy` function.\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\n### Compose basics (video collection)\n\nThis series of videos introduces various Compose APIs, quickly showing you what's available and how to use them. \n[Quick guide collection](/develop/ui/compose/quick-guides/collections/compose-basics) \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)"]]