0Pricing
Jetpack Compose Academy · درس

‏LazyColumn مقابل Column القابلة للتمرير

اعرف سبب قابلية القوائم الكسولة للتوسع

‏LazyColumn مقابل Column القابلة للتمرير درس مجاني في Jetpack Compose Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Jetpack Compose Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.

بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.

The Long-List Problem

When a list has hundreds of rows, you can't draw them all at once. You need a list that only builds what's actually visible on screen.

A Plain Column Builds Everything

A regular Column composes every single child immediately, even rows far below the screen. With long data, that wastes memory and time.

Column {
    items.forEach { Text(it) }
}

Column Needs verticalScroll

A plain Column doesn't even scroll on its own. You must add a verticalScroll modifier just to move past the screen edge.

Column(Modifier.verticalScroll(rememberScrollState())) {
    items.forEach { Text(it) }
}

Meet LazyColumn

A LazyColumn is the scrollable list built for big data. It composes rows on demand as you scroll, so the cost stays small. 🚀

LazyColumn {
    // items go here
}

Lazy Means On Demand

"Lazy" means a row is only created when it scrolls into view. Off-screen items simply don't exist yet, which keeps things fast and light.

Reuse, Not Rebuild

As rows leave the top, LazyColumn recycles them for new rows entering the bottom. A few dozen rows can serve thousands of items.

The items Block

Inside LazyColumn you describe content with an items block instead of a normal loop. Compose decides which ones to actually build.

LazyColumn {
    items(names) { name ->
        Text(name)
    }
}

Scrolling Is Built In

LazyColumn scrolls by default, so you never wrap it in verticalScroll. Adding one would actually cause a crash.

When a Column Is Fine

For a few fixed rows that all fit on screen, a plain Column is simpler and perfect. Reach for LazyColumn only when the list can grow.

Never Nest the Same Direction

Avoid putting a LazyColumn inside a vertically scrolling Column. The two scroll directions clash, and Compose can't measure the height.

Performance Is the Payoff

The big win is performance: smooth scrolling and steady memory no matter how long the data gets. That's why lazy lists scale.

Quick Check

Time to test which list to reach for.

Recap: Lazy Wins for Big Lists

A Column builds everything up front and needs verticalScroll; a LazyColumn builds rows on demand, recycles them, and scales effortlessly. 🎉

الأسئلة الشائعة

هل درس «‏LazyColumn مقابل Column القابلة للتمرير» مجاني؟

نعم — نص درس «‏LazyColumn مقابل Column القابلة للتمرير» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Jetpack Compose Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.

ماذا ستتعلم في «‏LazyColumn مقابل Column القابلة للتمرير»؟

اعرف سبب قابلية القوائم الكسولة للتوسع تتمرن على Jetpack Compose Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.

هل أحتاج إلى خبرة سابقة لأبدأ Jetpack Compose Academy؟

لا تُشترط خبرة سابقة. Jetpack Compose Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.

كم من الوقت يستغرق درس «‏LazyColumn مقابل Column القابلة للتمرير»؟

معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.

هل يمكنني كتابة وتشغيل أكواد في درس Jetpack Compose Academy هذا؟

نعم. كل درس في Jetpack Compose Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.

جميع الدروس في هذه الدورة

  1. ‏LazyColumn مقابل Column القابلة للتمرير
  2. ‏items وitemsIndexed
  3. مفاتيح للقوائم السريعة والمستقرة
  4. الترويسات الثابتة وقوائم الأقسام
← العودة إلى Jetpack Compose Academy