Material Design에서 스캐폴드는 복잡한 사용자 인터페이스를 위한 표준화된 플랫폼을 제공하는 기본 구조입니다. 앱 바, 플로팅 작업 버튼 등 UI의 여러 부분을 함께 유지하여 앱에 일관된 디자인을 제공합니다.
예
Scaffold 컴포저블은 Material Design 가이드라인에 따라 앱의 구조를 빠르게 어셈블하는 데 사용할 수 있는 간단한 API를 제공합니다.
Scaffold는 여러 컴포저블을 매개변수로 허용합니다. 여기에는 다음이 포함됩니다.
topBar: 화면 상단의 앱 바입니다.
bottomBar: 화면 하단의 앱 바입니다.
floatingActionButton: 주요 작업을 표시하는 데 사용할 수 있는 화면 오른쪽 하단에 마우스를 가져가면 표시되는 버튼입니다.
다른 컨테이너에 전달하는 것과 마찬가지로 Scaffold 콘텐츠를 전달할 수도 있습니다. 콘텐츠의 루트 컴포저블에 적용하여 크기를 제한해야 하는 content 람다에 PaddingValues를 전달합니다.
다음 예는 완전한 Scaffold 구현을 보여줍니다. 상단 앱 바, 하단 앱 바, 플로팅 작업 버튼이 포함되어 있습니다.
@ComposablefunScaffoldExample(){varpressesbyremember{mutableIntStateOf(0)}Scaffold(topBar={TopAppBar(colors=topAppBarColors(containerColor=MaterialTheme.colorScheme.primaryContainer,titleContentColor=MaterialTheme.colorScheme.primary,),title={Text("Top app bar")})},bottomBar={BottomAppBar(containerColor=MaterialTheme.colorScheme.primaryContainer,contentColor=MaterialTheme.colorScheme.primary,){Text(modifier=Modifier.fillMaxWidth(),textAlign=TextAlign.Center,text="Bottom app bar",)}},floatingActionButton={FloatingActionButton(onClick={presses++}){Icon(Icons.Default.Add,contentDescription="Add")}}){innerPadding->
Column(modifier=Modifier.padding(innerPadding),verticalArrangement=Arrangement.spacedBy(16.dp),){Text(modifier=Modifier.padding(8.dp),text=""" This is an example of a scaffold. It uses the Scaffold composable's parameters to create a screen with a simple top app bar, bottom app bar, and floating action button. It also contains some basic inner content, such as this text. You have pressed the floating action button $presses times. """.trimIndent(),)}}}
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-08-23(UTC)
[null,null,["최종 업데이트: 2025-08-23(UTC)"],[],[],null,["Scaffold\n========\n\nIn Material Design, a scaffold is a fundamental structure that provides a\nstandardized platform for complex user interfaces. It holds together different\nparts of the UI, such as app bars and floating action buttons, giving apps a\ncoherent look and feel.\n\nExample\n-------\n\nThe [`Scaffold`](/reference/kotlin/androidx/compose/material3/package-summary#Scaffold(androidx.compose.ui.Modifier,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,androidx.compose.material3.FabPosition,androidx.compose.ui.graphics.Color,androidx.compose.ui.graphics.Color,androidx.compose.foundation.layout.WindowInsets,kotlin.Function1)) composable provides a straightforward API you can use to\nquickly assemble your app's structure according to Material Design guidelines.\n`Scaffold` accepts several composables as parameters. Among these are the\nfollowing:\n\n- `topBar`: The app bar across the top of the screen.\n- `bottomBar`: The app bar across the bottom of the screen.\n- `floatingActionButton`: A button that hovers over the bottom-right corner of the screen that you can use to expose key actions.\n\n| **Note:** For more detailed examples on how you can implement both top and bottom app bars, see the app bars page.\n\nYou can also pass `Scaffold` content as you would to other containers. It passes\n`PaddingValues` to the `content` lambda that you should apply to your\ncontent's root composable to constrain its size.\n\nThe following example shows a complete `Scaffold` implementation. It contains a\ntop app bar, a bottom app bar, and a floating action button.\n\n\n```kotlin\n@Composable\nfun ScaffoldExample() {\n var presses by remember { mutableIntStateOf(0) }\n\n Scaffold(\n topBar = {\n TopAppBar(\n colors = topAppBarColors(\n containerColor = MaterialTheme.colorScheme.primaryContainer,\n titleContentColor = MaterialTheme.colorScheme.primary,\n ),\n title = {\n Text(\"Top app bar\")\n }\n )\n },\n bottomBar = {\n BottomAppBar(\n containerColor = MaterialTheme.colorScheme.primaryContainer,\n contentColor = MaterialTheme.colorScheme.primary,\n ) {\n Text(\n modifier = Modifier\n .fillMaxWidth(),\n textAlign = TextAlign.Center,\n text = \"Bottom app bar\",\n )\n }\n },\n floatingActionButton = {\n FloatingActionButton(onClick = { presses++ }) {\n Icon(Icons.Default.Add, contentDescription = \"Add\")\n }\n }\n ) { innerPadding -\u003e\n Column(\n modifier = Modifier\n .padding(innerPadding),\n verticalArrangement = Arrangement.spacedBy(16.dp),\n ) {\n Text(\n modifier = Modifier.padding(8.dp),\n text =\n \"\"\"\n This is an example of a scaffold. It uses the Scaffold composable's parameters to create a screen with a simple top app bar, bottom app bar, and floating action button.\n\n It also contains some basic inner content, such as this text.\n\n You have pressed the floating action button $presses times.\n \"\"\".trimIndent(),\n )\n }\n }\n}https://github.com/android/snippets/blob/dd30aee903e8c247786c064faab1a9ca8d10b46e/compose/snippets/src/main/java/com/example/compose/snippets/components/Scaffold.kt#L47-L100\n```\n\n\u003cbr /\u003e\n\nThis implementation appears as follows:\n**Figure 1.** An implementation of scaffold.\n\nAdditional resources\n--------------------\n\n- [App bars](/develop/ui/compose/components/app-bars)"]]