0
私のキーボードが私のEditTextに表示されるのを苦労しています。 EditTextを初めてクリックすると、キーボードが表示され、正常に動作します。キーボードが表示されませんonClick EditText
キーボードを隠して同じEditTextをもう一度クリックするために戻るボタンを押すと、キーボードが表示されません。私は本当に助けに感謝します。関連するコードは以下の通りです。
NewEntry:
assessor.setOnEditorActionListener(new TextView.OnEditorActionListener() {
@Override
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
if (actionId == EditorInfo.IME_ACTION_DONE) {
InputMethodManager inputMethodManager = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE);
inputMethodManager.hideSoftInputFromWindow(context.getCurrentFocus().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS);
EditText email = (EditText) context.findViewById(R.id.email);
email.requestFocus();
return true;
}
レイアウト:
<EditText
android:layout_height="72dp"
android:layout_width="wrap_content"
android:id="@+id/assessor"
android:textColor="@color/black"
android:textSize="20dp"
android:background="@android:color/transparent"
android:fontFamily="sans-serif-light"
android:layout_marginLeft="72dp"
android:layout_marginRight="16dp"
android:hint="Assessor"
android:inputType="text"
android:imeOptions="actionNext"
android:ems="10"
android:windowSoftInputMode="adjustPan"
/>
それはうまくいきませんでした。試していただきありがとうございます! :) –
私はそれがと関係があると思います。 HIDE_NOT_ALWAYS。なぜあなたはその部分が必要ですか? –