@Override
public void onClick(View v) { LinearLayout layout = (LinearLayout) View.inflate(context,
R.layout.system_setroom, null);
EditText text = (EditText) layout.findViewById(R.id.abc);
/*
* text.setOnFocusChangeListener(new OnFocusChangeListener() {
*
* public void onFocusChange(View v, boolean hasFocus) { if (hasFocus ==
* true) { InputMethodManager inputMgr = (InputMethodManager)
* getSystemService(Context.INPUT_METHOD_SERVICE);
* inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
* inputMgr.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT);
*
* } } });
*/
text.requestFocus();
text.setFocusableInTouchMode(true); pop = new PopSystem(context, layout);
pop.update();
pop.showAsDropDown(hello); }这是我写的按钮事件,点击按钮跳出一个popView,popView中有一个文本输入框,问题是我不想设置popWindow。setfouse为true,但是可以让文本输入框(EidtText)可以获得焦点,正常跳出软键盘可输入文字。现在点击挑不出来软键盘。求高手指点
public void onClick(View v) { LinearLayout layout = (LinearLayout) View.inflate(context,
R.layout.system_setroom, null);
EditText text = (EditText) layout.findViewById(R.id.abc);
/*
* text.setOnFocusChangeListener(new OnFocusChangeListener() {
*
* public void onFocusChange(View v, boolean hasFocus) { if (hasFocus ==
* true) { InputMethodManager inputMgr = (InputMethodManager)
* getSystemService(Context.INPUT_METHOD_SERVICE);
* inputMgr.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0);
* inputMgr.showSoftInput(v, InputMethodManager.SHOW_IMPLICIT);
*
* } } });
*/
text.requestFocus();
text.setFocusableInTouchMode(true); pop = new PopSystem(context, layout);
pop.update();
pop.showAsDropDown(hello); }这是我写的按钮事件,点击按钮跳出一个popView,popView中有一个文本输入框,问题是我不想设置popWindow。setfouse为true,但是可以让文本输入框(EidtText)可以获得焦点,正常跳出软键盘可输入文字。现在点击挑不出来软键盘。求高手指点
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货