假设我有一个从 java 文件打开的对话框。我想为这些对话框设置多行标题。
dialog = new Dialog(context);
dialog.setContentView(R.layout.issue_attachment_preview);
String title=getString(R.string.previewImageDialogTitle)+"\n ["+attachment.filename+"]";
dialog.setTitle(title);
dialog.setCancelable(true);
但它不显示多行标题,请给我任何可用的链接或示例。
最佳答案
TextView tv = (TextView) dialog.findViewById(android.R.id.title);
tv.setSingleLine(false);
关于android - 如何以多行显示对话框的标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8586508/