android.netxamarinsoft-input-panel

Hide soft input panel in Xamarin Android application on EditText focus


I'v been developing a Xamarin Android application and my activity contains multiple edittexts. When I focus the edittext by clicking on it the soft input panel appears, but I want this to remain hidden at all times. I already tried with the underlying code, but this doesn't work and I also tried with CurrentFocus instead of the edittext.

InputMethodManager keyboard = (InputMethodManager)GetSystemService(Context.InputMethodService);
keyboard.HideSoftInputFromWindow(txtWerf.WindowToken, HideSoftInputFlags.None);

Further I tried with windowsoftinputmode in the xml of my layout and in the manifest file.

EDIT

 <application android:label="WMS" android:icon="@drawable/Icon">
 <activity android:name="Materiaal" android:windowSoftInputMode="stateAlwaysHidden"></activity>
 </application>

Does anyone as an idea?


Solution

  • On each Edittext control you can set .ShowSoftInputOnFocus to false and the keyboard will not popup when clicking the edittext.