我的EditText
etDetailsNOte
和etTitleNote
打开键盘进行打字。请建议我可以改变什么。我在这里找不到任何错误。
popUpAddNote = new PopupWindow(this);
mainLayout = new LinearLayout(this);
etTitleNote = new EditText(this);
etDetailsNOte = new EditText(this);
bAdd = new Button(this);
bAddNewNote.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
if (click) {
popUpAddNote.showAtLocation(mainLayout,Gravity.CENTER, 10, 10);
popUpAddNote.update(50, 50, 250, 200);
click = false;
} else {
popUpAddNote.dismiss();
click = true;
}
}
});
params = new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
mainLayout.setOrientation(LinearLayout.VERTICAL);
etTitleNote.setHint("Title");
etTitleNote.setWidth(250);
mainLayout.addView(etTitleNote,params);
etDetailsNOte.setHint("Details");
etDetailsNOte.setInputType(InputType.TYPE_CLASS_TEXT
| InputType.TYPE_TEXT_VARIATION_PASSWORD);
etDetailsNOte.setWidth(250);
etDetailsNOte.setHeight(150);
mainLayout.addView(etDetailsNOte,params);
bAdd.setText("Add");
bAdd.setWidth(250);
mainLayout.addView(bAdd,params);
popUpAddNote.setContentView(mainLayout);
// setContentView(mainLayout);visible
答案 0 :(得分:0)
在活动清单
中添加以下内容机器人:windowSoftInputMode = “stateAlwaysVisible”