更改 AlertDialog 中 ListView 的字体大小
我有一个简单的 AlertDialog,它显示不同的标题,但有些标题太长,因此在对话框中被截断。如何调整整个ListView文本的字体大小,使其适合屏幕?
AlertDialog.Builder builder = new AlertDialog.Builder(MyMaps.this);
builder.setTitle("Titles");
builder.setItems(m_Titles, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int item)
{
dialog.dismiss();
/// DO SOME ON CLICK STUFF
}
});
AlertDialog alert = builder.create();
alert.show();
存在类似的问题,但这是关于解释如何更改TextView 的大小。
I have a simple AlertDialog that displays different titles, but some are too long so they are truncated in the dialog. How can I adjust the fontsize of the text of the entire ListView so that it fits the screen?
AlertDialog.Builder builder = new AlertDialog.Builder(MyMaps.this);
builder.setTitle("Titles");
builder.setItems(m_Titles, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int item)
{
dialog.dismiss();
/// DO SOME ON CLICK STUFF
}
});
AlertDialog alert = builder.create();
alert.show();
A similar question exists, but that's about explaining how to change the size of a TextView.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 XML 文件进行布局创建自定义对话框。
这是一个简单的示例 示例链接
you can create custom dialog using XML file for layout..
here is simple example for it Example's Link