新手求android中的dialog中的EditText怎么声明  在线等回答

解决方案 »

  1.   

    在layout 中建xml 然后在xml布局EditText。
      

  2.   

    应该是自定义你的Dialog的布局。
    1,先在你的layout中创建一个xml,完成你想要的布局。
    2,通过以下方法
    LayoutInflater inflater=(LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View view = inflater.inflate(R.layout.你自己定义的xml, null);
    3,获取EditText的引用,EditText editText = (EditText) view.findViewById(..);
    4,创建Dialog 在其中添加上此View,
    Dialog dialog = new Dialog(this);
    dialog.addContentView(view, LayoutParames layoutParames);
    5,dialog.show();
    应该可以试试吧!
      

  3.   

    嗯  dialogView.findViewById()就可以了