覆盖焦点更改侦听器后,Android Edittext软键盘问题

时间:2018-12-05 18:39:50

标签: android

如果edittext是ExpandableListView的子级,则在对焦点进行更改后,在edittext中进行监听,如果我们最小化键盘,然后再次单击该编辑文本,则不会再次出现软键盘。

@Override
protected void onFocusChanged(boolean focused, int direction, Rect previouslyFocusedRect) {
    showClearIcon(
            (!mClearIconDrawWhenFocused || focused) && !TextUtils.isEmpty(getText().toString()));
    super.onFocusChanged(focused, direction, previouslyFocusedRect);
}

清单

android:windowSoftInputMode="adjustPan"

0 个答案:

没有答案