Column: ترتيب العناصر رأسيًا
رتّب العناصر الفرعية من الأعلى إلى الأسفل
Column: ترتيب العناصر رأسيًا درس مجاني في Jetpack Compose Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Jetpack Compose Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Stacking Vertically
When you want children to sit top to bottom, you reach for Column. It is Compose's go-to layout for vertical stacks. 📚
Your First Column
A Column takes a trailing lambda. Every Composable you call inside it becomes a child, drawn in the order you write them.
Column {
Text("First")
Text("Second")
}Order Is Top to Bottom
Children stack in source order. The first Composable sits at the top, the next below it, and so on down the screen.
Mixing Different Children
A Column can hold any Composables, not just Text. Buttons, Images, and even other Columns all stack happily inside it.
Column {
Text("Title")
Button(onClick = {}) { Text("Go") }
}Default Sizing: Wrap Content
By default a Column is only as tall and wide as its children need. It shrinks to wrap its content unless you tell it otherwise.
Filling the Width
Add a Modifier to change size. fillMaxWidth makes the Column stretch across the whole screen horizontally.
Column(modifier = Modifier.fillMaxWidth()) {
Text("Wide column")
}Spacing Between Children
Use verticalArrangement with spacedBy to put even gaps between every child. No manual padding on each item needed.
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
Text("A")
Text("B")
}Aligning Children Sideways
Set horizontalAlignment to line children up. CenterHorizontally pulls them all to the middle of the Column's width.
Column(horizontalAlignment = Alignment.CenterHorizontally) {
Text("Centered")
}Columns Don't Scroll Yet
A plain Column does not scroll. If children run past the screen they get clipped, so it suits short, fixed lists best.
Adding Scroll When Needed
For longer content, attach verticalScroll to the Column's modifier. Now the whole stack scrolls as one piece.
Column(modifier = Modifier.verticalScroll(rememberScrollState())) {
Text("Long content")
}Nesting for Real Screens
Real screens nest Columns inside Columns. An outer Column holds sections, and each section is its own little Column of details.
Quick Check
Let's confirm how a Column arranges its children.
Recap: Column
You learned Column: it stacks children top to bottom in order, wraps content by default, and uses arrangement, alignment, and modifiers to size and space them.
الأسئلة الشائعة
هل درس «Column: ترتيب العناصر رأسيًا» مجاني؟
نعم — نص درس «Column: ترتيب العناصر رأسيًا» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Jetpack Compose Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.
ماذا ستتعلم في «Column: ترتيب العناصر رأسيًا»؟
رتّب العناصر الفرعية من الأعلى إلى الأسفل تتمرن على Jetpack Compose Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Jetpack Compose Academy؟
لا تُشترط خبرة سابقة. Jetpack Compose Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «Column: ترتيب العناصر رأسيًا»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Jetpack Compose Academy هذا؟
نعم. كل درس في Jetpack Compose Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- Column: ترتيب العناصر رأسيًا
- Row: وضع العناصر جنبًا إلى جنب
- Box: التكديس والتداخل
- التوزيع والمحاذاة