1

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
4

1 に答える 1

0

アクティビティマニフェストに以下を追加します

android:windowSoftInputMode = "stateAlwaysVisible"

于 2013-03-14T01:14:51.303 に答える