이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 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\nTry the Compose way \nJetpack Compose is the recommended UI toolkit for Android. Learn how to work with a stylus in Compose. \n[Stylus input in text fields →](/develop/ui/compose/touch-input/stylus-input/stylus-input-in-text-fields) \n\n\u003cbr /\u003e\n\nAndroid 14 (API level 34) and higher enable users to write into any text input\nfield in any app using a stylus. Android text entry fields, including\n[`EditText`](/reference/kotlin/android/widget/EditText) components and\n[`WebView`](/reference/kotlin/android/webkit/WebView) text widgets, support\nstylus input by default.\n\nHowever, if your app requires custom text input fields (see [Custom text\neditors](/develop/ui/views/touch-and-input/stylus-input/custom-text-editors)) or\nhas a complex layout with text entry fields overlaying a drawing surface, you'll\nneed to customize your app.\nYour browser doesn't support the video tag. **Figure 1.** Handwritten input with a stylus.\n\n`EditText`\n----------\n\nStylus handwriting is enabled for all `EditText` fields by default on Android 14\nand higher. Handwriting mode is started for an `EditText` when a stylus motion\nevent is detected within the handwriting bounds of the view.\n\nThe handwriting bounds include 40 dp of vertical padding and 10 dp of horizontal\npadding around the view. Adjust the handwriting bounds with\n[`setHandwritingBoundsOffsets()`](/reference/kotlin/android/view/View#sethandwritingboundsoffsets).\nDisable handwriting with\n[`setAutoHandwritingEnabled(false)`](/reference/kotlin/android/view/View#setautohandwritingenabled).\n| **Figure 2.** Handwriting bounds of `EditText` fields. **Note:** Stylus handwriting is not supported for `EditText` fields that have the password input type, for example: \n|\n| ```xml\n| \u003cEditText\n| ...\n| android:inputType=\"textPassword\"\n| ... /\u003e\n| ```\n|\n| See [`android:inputType`](/reference/android/widget/TextView#attr_android:inputType).\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\n[`setHandwritingDelegatorCallback()`](/reference/kotlin/android/view/View#sethandwritingdelegatorcallback)\nand\n[`setIsHandwritingDelegate()`](/reference/kotlin/android/view/View#setishandwritingdelegate)).\nThe placeholder UI element is configured to delegate handwriting to a functional\ninput field, for example: \n\n### Kotlin\n\n```kotlin\nif (Build.VERSION.SDK_INT \u003e= 34) {\n placeholderInputField.setHandwritingDelegatorCallback {\n showAndFocusDelegateInputField()\n }\n delegateInputField.setIsHandwritingDelegate(true)\n}\n```\n\n### Java\n\n```java\nif (Build.VERSION.SDK_INT \u003e= 34) {\n placeholderInputField.setHandwritingDelegatorCallback(this::showAndFocusInputFieldDelegate);\n delegateInputField.setIsHandwritingDelegate(true);\n}\n```\n\nStylus motion over the placeholder text input field view invokes the callback.\nThe callback triggers the UI transition to show and focus the functional input\nfield. The callback implementation is typically the same as the implementation\nfor a click listener on the placeholder element. When the functional input field\ncreates an\n[`InputConnection`](/reference/kotlin/android/view/inputmethod/InputConnection),\nstylus handwriting mode starts.\nYour browser doesn't support the video tag. **Figure 4.** Stylus input delegation from static UI element to text input field.\n\n### Material Design\n\nThe\n[`com.google.android.material.search`](/reference/com/google/android/material/search/package-summary)\nlibrary provides the\n[`SearchBar`](/reference/com/google/android/material/search/SearchBar) and\n[`SearchView`](/reference/com/google/android/material/search/SearchView) classes\nto facilitate implementation of the placeholder UI pattern.\n\nPlaceholder and functional search views are linked with\n[`setUpWithSearchBar()`](/reference/com/google/android/material/search/SearchView#setupWithSearchBar(com.google.android.material.search.SearchBar)).\n\nHandwriting delegation is configured in the Material library with no additional\ndevelopment required in your app.\n\nOverlap with drawing surfaces\n-----------------------------\n\nIf your app has a drawing surface with a text field overlaying the surface, you\nmay need to disable stylus handwriting to allow the user to draw. See\n[`setAutoHandwritingEnabled()`](/reference/kotlin/android/view/View#setautohandwritingenabled).\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- [Custom text editors](/develop/ui/views/touch-and-input/stylus-input/custom-text-editors)"]]