有没有人知道如何在使用setMultiChoiceItems(...)设置多项选择项时自定义AlertDialog中的项目。我想改变项目的文字大小。Android AlertDialog带有自定义项目的多项选择
感谢
有没有人知道如何在使用setMultiChoiceItems(...)设置多项选择项时自定义AlertDialog中的项目。我想改变项目的文字大小。Android AlertDialog带有自定义项目的多项选择
感谢
当然,您可以使用Dialog.setContentView()将对话框的内容设置为任意布局。
Dialog dialog = new Dialog(this);
dialog.setContentView(R.layout.yourLayoutId);
dialog.show();
让自己与你想在它和调用的setContentView您的对话框上的一个组件的布局文件,通过你的布局文件的名称。
如果你是deadset上AlertDialog你可以用builder.setView()类似
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.yourLayoutId, (ViewGroup) findViewById(R.id.yourLayoutRoot));
AlertDialog.Builder builder = new AlertDialog.Builder(this)
.setView(layout);
AlertDialog alertDialog = builder.create();
alertDialog.show();
您可以创建自定义AlertDialog在那里你可以改变任何元素的文字大小。一个简单的通用示例:http://android-codes-examples.blogspot.in/2011/03/how-to-display-custom-dialog-and.html
伟大它的作品,我可以给+1只:( – Jaguar 2012-12-13 13:14:43
谢谢@Jaguar – 2012-12-15 06:10:32
的问题是关于多选择的部分比布局多,我现在正在寻找同样的东西...... – DoruChidean 2015-07-09 16:00:26