스타일러스 필기 입력은 모든 TextField 구성요소에 기본적으로 사용 설정됩니다.
Android 14 이상 및
androidx.compose.foundation:foundation:1.7.0
종속됩니다. 스타일러스가 움직일 때 TextField에 필기 입력 모드가 시작됩니다.
이벤트가 구성요소의 필기 입력 경계 내에서 감지됩니다.
필기 입력 경계에는 세로 패딩 40dp, 가로 10dp가 포함됩니다.
입력 필드 주위에 패딩이 있습니다.
앱은 텍스트 입력란처럼 보이는 자리표시자 UI 요소를 표시할 수 있지만
사실은 텍스트 입력 기능이 없는 정적 UI 요소일 뿐입니다. 검색
필드가 일반적인 예입니다. 정적 UI 요소를 탭하면 전환 트리거
입력에 중점을 둔 기능적 텍스트 입력란이 포함된 새로운 UI로 변경되었습니다.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 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,["# Stylus input in text fields\n\nThe Jetpack\n[`androidx.compose.material3`](/jetpack/androidx/releases/compose-material3)\nlibrary enables users to write into any [`TextField`](/reference/kotlin/androidx/compose/material/package-summary#TextField(androidx.compose.ui.text.input.TextFieldValue,kotlin.Function1,androidx.compose.ui.Modifier,kotlin.Boolean,kotlin.Boolean,androidx.compose.ui.text.TextStyle,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Function0,kotlin.Boolean,androidx.compose.ui.text.input.VisualTransformation,androidx.compose.foundation.text.KeyboardOptions,androidx.compose.foundation.text.KeyboardActions,kotlin.Boolean,kotlin.Int,kotlin.Int,androidx.compose.foundation.interaction.MutableInteractionSource,androidx.compose.ui.graphics.Shape,androidx.compose.material.TextFieldColors)) component in\nany app using a stylus.\nYour browser doesn't support the video tag. **Figure 1.** Handwritten input with a stylus.\n\nTo enable stylus input by default, add the library dependency to your app's\n`build.gradle` file: \n\n### Kotlin\n\n```kotlin\ndependencies {\n implementation(\"androidx.compose.foundation:foundation:\u003cvar translate=\"no\"\u003eLATEST_COMPOSE_VERSION\u003c/var\u003e\")\n}\n\nandroid {\n buildFeatures {\n compose = true\n }\n\n composeOptions {\n kotlinCompilerExtensionVersion = \"\u003cvar translate=\"no\"\u003eLATEST_EXTENSION_VERSION\u003c/var\u003e\"\n }\n\n kotlinOptions {\n jvmTarget = \"\u003cvar translate=\"no\"\u003eLATEST_JVM_VERSION\u003c/var\u003e\"\n }\n}\n```\n\n### Groovy\n\n```groovy\ndependencies {\n implementation 'androidx.compose.foundation:foundation:\u003cvar translate=\"no\"\u003eLATEST_COMPOSE_VERSION\u003c/var\u003e'\n}\n\nandroid {\n buildFeatures {\n compose true\n }\n\n composeOptions {\n kotlinCompilerExtensionVersion = '\u003cvar translate=\"no\"\u003eLATEST_EXTENSION_VERSION\u003c/var\u003e'\n }\n\n kotlinOptions {\n jvmTarget = '\u003cvar translate=\"no\"\u003eLATEST_JVM_VERSION\u003c/var\u003e'\n }\n}\n```\n\n`TextField`\n-----------\n\nStylus handwriting is enabled for all `TextField` components by default on\nAndroid 14 and higher and the\n[`androidx.compose.foundation:foundation:1.7.0`](/jetpack/androidx/releases/compose-foundation)\ndependency. Handwriting mode is started for a `TextField` when a stylus motion\nevent is detected within the handwriting bounds of the component.\n\nThe handwriting bounds include 40 dp of vertical padding and 10 dp of horizontal\npadding around the input field.\n**Figure 2.** Handwriting bounds of `TextField` components.\n\nStylus handwriting is not supported for `TextField` fields when the input method\neditor is requested with [`KeyboardType.Password`](/reference/kotlin/androidx/compose/ui/text/input/KeyboardType#Password()).\n\nInput delegation\n----------------\n\nApps can display placeholder UI elements that appear to be text input fields but\nare actually just static UI elements with no text input capability. Search\nfields are a common example. Tapping the static UI element triggers a transition\nto a new UI that contains a functional text input field focused for input.\nYour browser doesn't support the video tag. **Figure 3.** Input delegation from static UI element to text input field.\n\n### Stylus input delegation\n\nUse the handwriting delegation APIs to support stylus handwriting input for\nplaceholder input fields (see [`handwritingDetector`](/reference/kotlin/androidx/compose/foundation/text/handwriting/package-summary#(androidx.compose.ui.Modifier).handwritingDetector(kotlin.Function0)) and\n[`handwritingHandler`](/reference/kotlin/androidx/compose/foundation/text/handwriting/package-summary#(androidx.compose.ui.Modifier).handwritingHandler())). The placeholder UI element is\nconfigured to delegate handwriting to a functional input field. For an example\nimplementation, see\n[`HandwritingDetectorSample.kt`](https://cs.android.com/androidx/platform/frameworks/support/+/androidx-main:compose/foundation/foundation/samples/src/main/java/androidx/compose/foundation/samples/HandwritingDetectorSample.kt).\n\nStylus handwriting mode starts when the functional input field gains focus and\ncreates an\n[`InputConnection`](/reference/kotlin/android/view/inputmethod/InputConnection).\nYour browser doesn't support the video tag. **Figure 4.** Stylus input delegation from static UI element to text input field.\n\nTesting\n-------\n\nStylus handwriting is supported on Android 14 and higher devices with a\ncompatible stylus input device and an [input method\neditor](/develop/ui/views/touch-and-input/creating-input-method) (IME) that\nsupports the Android 14 stylus handwriting APIs.\n\nIf you don't have a stylus input device, simulate stylus input on any device\nwith root access (including emulators) using the following Android Debug Bridge\n(adb) commands: \n\n\n // Android 14\n adb shell setprop persist.debug.input.simulate_stylus_with_touch true && adb shell stop && adb shell start\n\n // Android 15 and higher\n // Property takes effect after screen reconfiguration such as orientation change.\n adb shell setprop debug.input.simulate_stylus_with_touch true\n\nUse the Gboard beta for testing if you are using a device that doesn't support\nstylus.\n\nAdditional resources\n--------------------\n\n- Material Design --- [Text fields](https://m3.material.io/components/text-fields/overview)\n- [Handle user input](/develop/ui/compose/text/user-input)"]]