ProtoLayout Material 라이브러리의 레이아웃은 이미 반응형이며 올바른 요소 배치와 표시 상태를 처리합니다. 그러나 최상의 결과를 얻기 위해 표시되는 요소의 수를 변경해야 하는 경우도 있습니다. 예를 들어 작은 디스플레이에는 버튼 3개를, 큰 디스플레이에는 버튼 5개를 표시할 수 있습니다.
이러한 차별화된 환경을 구현하려면 화면 크기 중단점을 사용하세요. 화면 크기가 225dp를 초과할 때 다른 레이아웃을 표시하려면 다음을 실행합니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-07-27(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-07-27(UTC)"],[],[],null,["# Develop tiles for different screen sizes\n\nTiles for Wear OS version 2.5 3\n\n*** ** * ** ***\n\nYour app's tiles should work well on Wear OS devices of all sizes, taking\nadvantage of additional space where available, and still look great on smaller\nscreens too. This guide provides recommendations for achieving this user\nexperience.\n\nTo learn more about the design principles for adaptive layouts, read the\n[design guidance](/design/ui/wear/guides/foundations/adaptive-layouts).\n\nBuild responsive layouts using ProtoLayout\n------------------------------------------\n\nThe [ProtoLayout Material](/reference/androidx/wear/protolayout/material/layouts/package-summary) library provides predefined layouts to help you\nbuild your tiles. These layouts are already designed to adapt to the screen\nsize.\n\nRefer to the [Figma design layouts](/downloads/design/material-2-5-tiles-wear-os-design-kit-v2-3.fig), which demonstrate the canonical\nlayouts available and how to build your design using them:\n\n- [`PrimaryLayout`](/reference/androidx/wear/protolayout/material/layouts/PrimaryLayout)\n- [`EdgeContentLayout`](/reference/androidx/wear/protolayout/material/layouts/EdgeContentLayout)\n- [`MultiButtonLayout`](/reference/androidx/wear/protolayout/material/layouts/MultiButtonLayout)\n- [`MultiSlotLayout`](/reference/androidx/wear/protolayout/material/layouts/MultiSlotLayout)\n\nWe recommend [`PrimaryLayout`](/reference/androidx/wear/protolayout/material/layouts/PrimaryLayout) or [`EdgeContentLayout`](/reference/androidx/wear/protolayout/material/layouts/EdgeContentLayout) as top-level\nlayouts for most use cases. Set the responsive behavior using\n`setResponsiveContentInsetEnabled`, for example: \n\n PrimaryLayout.Builder(deviceParameters)\n .setResponsiveContentInsetEnabled(true)\n .setContent(\n // ...\n )\n .build()\n\nProvide differentiated experiences through breakpoints\n------------------------------------------------------\n\nLayouts from the [ProtoLayout Material](/reference/androidx/wear/protolayout/material/layouts/package-summary) library are already responsive and\ntake care of correct element placement and visibility. However, in some cases\nyou might want to vary the number of visible elements for best results. For\nexample, you might want 3 buttons on a smaller display, and 5 on a larger\ndisplay.\n\nTo implement this sort of differentiated experience, use *screen size\nbreakpoints*. To show a different layout when the screen size exceeds 225 dp: \n\n materialScope(context, deviceConfiguration) {\n primaryLayout(\n mainSlot = {\n buttonGroup {\n buttonGroupItem { button1 }\n buttonGroupItem { button2 }\n buttonGroupItem { button3 }\n if (deviceConfiguration.screenHeightDp \u003e= 225) {\n buttonGroupItem { button4 }\n buttonGroupItem { button5 }\n }\n }\n }\n )\n }\n\nThe [design guidance](/design/ui/wear/guides/foundations/adaptive-layouts) illustrates additional opportunities.\n\nTest tiles on different screen sizes using Previews\n---------------------------------------------------\n\nIt is important to test your layouts on different screen sizes. Use the\nTile Preview annotations, along with the [`TilePreviewHelper`](/reference/androidx/wear/tiles/tooling/preview/TilePreviewHelper) and\n[`TilePreviewData`](/reference/androidx/wear/tiles/tooling/preview/TilePreviewData) classes: \n\n @Preview(device = WearDevices.LARGE_ROUND)\n fun smallPreview(context: Context) = TilePreviewData(\n onTileRequest = { request -\u003e\n TilePreviewHelper.singleTimelineEntryTileBuilder(\n buildLayout()\n ).build()\n }\n )\n\nThis lets you preview your Tile layouts directly within Android Studio. The\nprevious [breakpoints](#breakpoints) example illustrates how additional buttons\nare shown when the screen space allows, when previewed: \n\n*Small and large displays showing the effect of the breakpoint*\n\nFor a full example, see the [media tiles sample](https://github.com/android/wear-os-samples/blob/66fd43b09cc12b26c9f8cc11ea45d97e3733761d/WearTilesKotlin/app/src/debug/java/com/example/wear/tiles/golden/Media.kt) on GitHub."]]