从自动请求焦点的Andr​​oid prevent的EditText焦点、Andr、oid、prevent

2023-09-07 11:22:03 作者:是这日子在熬我

我有一个非常简单的布局有一个EditText和一个按钮。问题是,该活动已经启动,而EditText上获得焦点后键盘会出现。我删除了< / requestFocus的> 从XML和我也没有做,在code。我怎样才能prevent EditText上的这种行为使键盘仅出现在使用水龙头EDITTEXT后?

解决方案

 安卓windowSoftInputMode =stateHidden
 

I have a quite simple Layout with an EditText and a button. The problem is the keyboard appears immediately after the activity is started and the EditText gets the focus. I removed the </requestFocus> from XML and I also don't do that in code. How can I prevent that behavior of EditText so the keyboard only appears after the used taps the editText?

解决方案

android:windowSoftInputMode="stateHidden"