android

[안드로이드] EditText 기본 입력 언어 설정

boywin1992 2022. 5. 21. 11:06
728x90

핵심 코드

 

android:privateImeOptions="defaultInputmode=korean"
android:privateImeOptions="defaultInputmode=english"

 


설명

 

위 코드를 활용하여 EditText 에 기본 언어를 설정할 수 있습니다.


전체 코드

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:focusable="true"
    android:focusableInTouchMode="true"
    tools:context=".MainActivity">

    <EditText
        android:privateImeOptions="defaultInputmode=korean"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

</LinearLayout>

 

구동 화면

(1) android:privateImeOptions="defaultInputmode=korean"

(2) android:privateImeOptions="defaultInputmode=english"

728x90