新手求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设计求思路 怎么在Widget被添加到桌面之前,进行阻止 如何实现微信摇一摇然后弹出的小窗口 虚心求教 tabhost里子tab跳转还保持tabhost问题 高手快来,一个很有挑战的问题:代码调用外部程序并传参 如何控制touchkey的背光? Gradle 3.1-rc-1 requires Java 7 or later to run.You are currently using Java 6 【求助】HelloCharts柱状图怎么设置柱子宽度 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();
应该可以试试吧!