「Android/レイアウト/フォーカス」の版間の差分
提供: 初心者エンジニアの簡易メモ
(→フォーカスを当てる) |
|||
| 行11: | 行11: | ||
==フォーカスを外す== | ==フォーカスを外す== | ||
別の適当なTextViewなどにフォーカスを当てる | 別の適当なTextViewなどにフォーカスを当てる | ||
| − | + | <pre> | |
| + | <TextView | ||
android:layout_width=”wrap_content” | android:layout_width=”wrap_content” | ||
android:layout_height=”wrap_content”> | android:layout_height=”wrap_content”> | ||
<requestFocus/> | <requestFocus/> | ||
| − | + | </TextView> | |
| + | </pre> | ||
2018年11月16日 (金) 10:17時点における最新版
フォーカスを当てる
<EditText
android:id=”@+id/EditText1″
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”>
<requestFocus/>
</EditText>
フォーカスを外す
別の適当なTextViewなどにフォーカスを当てる
<TextView
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”>
<requestFocus/>
</TextView>
