SoftKeyboard不是在横向模式下自动显示 [英] SoftKeyboard not Appearing automatically in Landscape Mode
本文介绍了SoftKeyboard不是在横向模式下自动显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的EditText
与< requestFocus的/>
中的XML。当我打开的纵向模式活动的软键盘自动显示,但是当我开始在风景模式活动的软键盘没有出现自动。我需要触摸的EditText
软键盘。
I have EditText
with with <requestFocus />
in the XML . when I open the Activity in Portrait Mode the soft keyboard Appearing automatically,But when I start the activity in Landscape Mode the soft-keyboard not appeared automatically .I required touching the EditText
for soft-keyboard .
想要一个软键盘在横向模式下自动出现。
Android清单
<activity
android:name="activity"
android:windowSoftInputMode="adjustResize"
>
什么问题好心帮我
whats a problem kindly help me
推荐答案
请检查这一点,我有测试此解决方案,它是完美的工作。
Please check this ,I have test this solution and it is working perfect
@Override
protected void onResume() {
super.onResume();
mUserNameEdit.requestFocus();
mUserNameEdit.postDelayed(new Runnable() {
@Override
public void run() {
// TODO Auto-generated method stub
InputMethodManager keyboard = (InputMethodManager)
getSystemService(Context.INPUT_METHOD_SERVICE);
keyboard.showSoftInput(mUserNameEdit, 0);
}
},200);
}
这篇关于SoftKeyboard不是在横向模式下自动显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文