新手求android中的dialog中的EditText怎么声明 新手求android中的dialog中的EditText怎么声明 在线等回答 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 在layout 中建xml 然后在xml布局EditText。 应该是自定义你的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();应该可以试试吧! 嗯 dialogView.findViewById()就可以了 android和window phone 7 学习经历 关于服务与activity通讯的问题 如何生成android可用的SO文件 手机游戏客户端开发具体是干什么啊?? 注册Accelerometer Sensor会引起内存泄露?? [Android] Build windows sdk出错 android系统上传文件可以成功接收但是会出现文件名乱码的情况 代码贴出 求指点 ubuntu怎么把openjdk7换回jdk6jre android新手求教,大神帮帮忙 android程序内语言转换 OpenGL ES实现图片展示的效果
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();
应该可以试试吧!