EditText in dialog android

I did edittext in the dialog box, but I cannot change the height.

AlertDialog.Builder editalert = new AlertDialog.Builder(this);

editalert.setTitle("messagetitle");
editalert.setMessage("here is the message");


final EditText input = new EditText(this);
LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
        LinearLayout.LayoutParams.FILL_PARENT,
        LinearLayout.LayoutParams.FILL_PARENT);
input.setLayoutParams(lp);
editalert.setView(input);

editalert.setPositiveButton("Send via email", new DialogInterface.OnClickListener() {
    public void onClick(DialogInterface dialog, int whichButton) {


    }
});


editalert.show();
+5
source share
2 answers

You can use this:

edittext.setHeight(100);
+3
source

I think it's too late, but you can try this.

LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(
                    LinearLayout.LayoutParams.MATCH_PARENT,
                    LinearLayout.LayoutParams.WRAP_CONTENT);
0
source

All Articles