java - 在多行上包装 android 对话框标题

标签 java android dialog google-api

有没有办法将 Android 自定义对话框中的标题包装成多行?无需制作 AlertDialog ?

dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle(itemTitle);

“itemTitle”有时太长,只能显示一半的文本。 enter image description here

最佳答案

答案复制自 this question

你可以让对话框标题多行:

TextView title = (TextView) dialog.findViewById(android.R.id.title);
title.setSingleLine(false);

关于java - 在多行上包装 android 对话框标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8152767/

相关文章:

java - JOptionPanel 上出现不可预测的 java 程序运行时错误

android - QuietlyCoding NumberPicker如何使用setOnPreferenceChangeListener?

Jquery 模态对话框禁用 Internet Explorer 8 兼容模式中的对话框

android - 屏幕旋转后保留上下文菜单

java - 防止 Android One 设备中的屏幕捕获

android - 如何通过 adb 在连接的设备之一上安装 apk?

android - 重用 fragment 来创建对话框

java - 使用正则表达式验证

java - 有什么办法可以解决 "java.lang.RuntimeException: Unable to find a free port"问题

java - 将 jscrollbar 附加到另一个组件