Ukryj miękką klawiaturę podczas ładowania aplikacji
Mam aplikację z elementem EditText
w widoku głównym.
Oznacza to, że po załadowaniu mojej aplikacji miękka klawiatura jest domyślnie wyświetlana.
Chciałbym móc ukryć klawiaturę przy ładowaniu,
nie wyświetla się, dopóki nie dotknę widoku EditText
.
30
3 answers
Możesz zrobić coś prostszego. Dodaj to do LinearLayout (lub dowolnego innego układu będącego korzeniem):
<LinearLayout
...
android:focusable="true"
android:focusableInTouchMode="true"
...
/>
25
Author: neteinstein,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-07-22 11:12:51
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-07-22 11:12:51
W Twoim AndroidManifest.xml
:
<activity android:name="com.your.package.ActivityName"
android:windowSoftInputMode="stateHidden" />
Więcej szczegółów na temat windowSoftInputMode
można znaleźć tutaj .
To ustawienie ukryje miękką klawiaturę, gdy użytkownik wprowadzi nową aktywność (nawet jeśli kontrola EditText uzyska fokus). Miękka klawiatura będzie wyświetlana tylko wtedy, gdy użytkownik kliknie kontrolkę edytuj okno.
75
Author: inazaruk,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-05-25 10:08:46
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-05-25 10:08:46
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
To się ukryje w każdej sytuacji.
EditText edtView=(EditText)findViewById(R.id.editTextConvertValue);
edtView.setInputType((InputType.TYPE_NULL);
5
Author: John Cooper,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-05-25 10:08:45
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-05-25 10:08:45