표시 텍스트
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
텍스트를 표시하는 가장 기본적인 방법은 String
을 인수로 Text
컴포저블을 사용하는 것입니다.
@Composable
fun SimpleText() {
Text("Hello World")
}
리소스의 텍스트 표시
동일한 문자열을 Android 뷰와 공유하고 앱 국제화(i18n)를 준비할 수 있도록 Text
값을 하드코딩하는 대신 문자열 리소스를 사용하는 것이 좋습니다.
@Composable
fun StringResourceText() {
Text(stringResource(R.string.hello_world))
}
추천 서비스
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2025-09-03(UTC)
[null,null,["최종 업데이트: 2025-09-03(UTC)"],[],[],null,["The most basic way to display text is to use the `Text` composable with a\n`String` as an argument:\n\n\n```kotlin\n@Composable\nfun SimpleText() {\n Text(\"Hello World\")\n}https://github.com/android/snippets/blob/30ed522851a9273c94afcd3a4c30bf674346ad18/compose/snippets/src/main/java/com/example/compose/snippets/text/TextSnippets.kt#L107-L110\n```\n\n\u003cbr /\u003e\n\nDisplay text from resource\n\nWe recommend you use [string resources](/develop/ui/compose/resources#strings)\ninstead of hardcoding `Text` values, as you can share the same strings with your\nAndroid Views as well as preparing your app for internationalization:\n\n\n```kotlin\n@Composable\nfun StringResourceText() {\n Text(stringResource(R.string.hello_world))\n}https://github.com/android/snippets/blob/30ed522851a9273c94afcd3a4c30bf674346ad18/compose/snippets/src/main/java/com/example/compose/snippets/text/TextSnippets.kt#L116-L119\n```\n\n\u003cbr /\u003e\n\nRecommended for you\n\n- Note: link text is displayed when JavaScript is off\n- [Enable user interactions](/develop/ui/compose/text/user-interactions)\n- [Thinking in Compose](/develop/ui/compose/mental-model)\n- [Display emoji](/develop/ui/compose/text/emoji)"]]