gpt4 book ai didi

java - 如何更改警报对话框中复选框列表的文本大小

转载 作者:行者123 更新时间:2023-12-01 06:16:41 25 4
gpt4 key购买 nike

我正在开发一个具有多个复选框的警报对话框。如何更改复选框列表元素的文本大小? (我可以更改标题和按钮的大小)

boolean[] allBoolean = {true, true, true, true, true, true, true, true};

AlertDialog.Builder prompt = new AlertDialog.Builder(Class.this);
prompt.setTitle("Title");
prompt.setMultiChoiceItems(all, allBoolean, new DialogInterface.OnMultiChoiceClickListener() {
@Override
public void onClick(DialogInterface dialog, int which, boolean isChecked) {
allBoolean[which] = isChecked;
}
});
prompt.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//do nothing
}
});
prompt.setPositiveButton("Select", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
//do something
}
});

最佳答案

alertDialog.show();
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();

lp.copyFrom(alertDialog.getWindow().getAttributes());
lp.width = 150;
lp.height = 500;
lp.x=-170;
lp.y=100;
alertDialog.getWindow().setAttributes(lp);

关于java - 如何更改警报对话框中复选框列表的文本大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23053098/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com