Scaffold: الهيكل الأساسي للشاشة
اربط مواضع تخطيط التطبيق القياسية
Scaffold: الهيكل الأساسي للشاشة درس مجاني في Jetpack Compose Academy على CoddyKit. هذا هو الدرس 1 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Jetpack Compose Academy، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Meet Scaffold
Most app screens share the same skeleton: a bar on top, content in the middle, maybe a button floating below. Scaffold gives you all of that in one Composable. 🏗️
Why Not Just a Column?
You could hand-build bars with a Column, but you would re-solve insets, spacing, and overlaps every time. Scaffold wires those standard pieces together for you.
The Slot Idea
Scaffold works with slots: named spots where you drop a Composable. You fill the slots you want and leave the rest empty.
The content Slot
The one slot you almost always use is content. It is the main body of your screen, and Scaffold hands it the right padding to use.
Scaffold { innerPadding ->
Text("Hello", Modifier.padding(innerPadding))
}Honor innerPadding
That innerPadding keeps your content from hiding under bars. Always apply it to your top-level content, or text can slip beneath the app bar.
The topBar Slot
Drop a bar into the topBar slot and Scaffold pins it to the top, then shrinks the content area so nothing overlaps.
Scaffold(
topBar = { TopAppBar(title = { Text("Home") }) }
) { padding -> }More Slots Available
Scaffold also offers bottomBar, floatingActionButton, and snackbarHost slots. You will meet each one in this course.
Leave Slots Empty
Every slot is optional. A Scaffold with only content is perfectly valid, so you add bars only when a screen actually needs them.
One Scaffold Per Screen
The usual rule is one Scaffold per screen. It frames that whole screen, while smaller Composables fill its content slot.
Scaffold Is Material 3
Import Scaffold from androidx.compose.material3 so its colors and spacing match the rest of your Material You theme.
import androidx.compose.material3.ScaffoldcontainerColor
Set containerColor to paint the screen background behind every slot. Skip it and Scaffold uses your theme's surface color by default.
Quick Check
What is the safest thing to do with the value Scaffold passes to its content lambda?
Recap
Scaffold is your screen skeleton: fill named slots like content and topBar, honor innerPadding, and use one per screen. Next you will style the top bar. 👍
الأسئلة الشائعة
هل درس «Scaffold: الهيكل الأساسي للشاشة» مجاني؟
نعم — نص درس «Scaffold: الهيكل الأساسي للشاشة» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Jetpack Compose Academy، انتقل إلى CoddyKit PRO. تتضمن دورة Jetpack Compose Academy 4 دروس في المجموع.
ماذا ستتعلم في «Scaffold: الهيكل الأساسي للشاشة»؟
اربط مواضع تخطيط التطبيق القياسية تتمرن على Jetpack Compose Academy مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Jetpack Compose Academy؟
لا تُشترط خبرة سابقة. Jetpack Compose Academy على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 1 من أصل 4.
كم من الوقت يستغرق درس «Scaffold: الهيكل الأساسي للشاشة»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Jetpack Compose Academy هذا؟
نعم. كل درس في Jetpack Compose Academy يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- Scaffold: الهيكل الأساسي للشاشة
- TopAppBar وأيقونات الإجراءات
- الأشرطة السفلية وأزرار الإجراءات العائمة
- Snackbars وSnackbarHostState