티스토리 뷰
root layout 에 아래 두 코드를 삽입하세요.
android:focusable="true"
android:focusableInTouchMode="true"
위 코드는 EditText 에 포커스가 자동으로 가는 것을 방지해 줍니다.
실행하는 뷰에 EditText 가 있다면 해당 EditText 로 포커스가 이동 되는 것은 기본값이기 때문입니다.
EditText 로 포커스가 이동되면 자동으로 키보드가 올라옵니다.
아래에 참고하실 전체 코드를 첨부해 놓을게요.
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
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:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="Hello World!"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
'android' 카테고리의 다른 글
android web view settings (0) | 2022.05.23 |
---|---|
how to remove title from android app (0) | 2022.05.23 |
그라데이션 효과 적용하는 방법 (0) | 2022.05.22 |
play kotlin (0) | 2022.05.22 |
how to get fcm token (0) | 2022.05.21 |
- Total
- Today
- Yesterday
- web view settings
- 코틀린
- 안드로이드
- simpleName
- andorid
- Android
- 로그캣
- defaultInputmode
- javaClass
- permissions
- 화면 고정
- Inputmode
- custom web view
- create project
- web view
- kotlin
- logcat
- StringWriter
- 웹뷰
- new project
- create new project
- 화면 방향 고정
- check permissions
- screenorientation
- 외부 브라우저
- 영문 키보드
- logtag
- 클래스 이름
- android studio
- web chrome view
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |