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

JFF*_*FFF 1 java android dialog google-api

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

dialog.setContentView(R.layout.custom_dialog);
dialog.setTitle(itemTitle);
Run Code Online (Sandbox Code Playgroud)

"itemTitle"有时太长,只显示一半的文本.在此输入图像描述

Amj*_*Saa 6

这个问题复制的答案

您可以将对话框标题设为多行:

TextView title = (TextView) dialog.findViewById(android.R.id.title);
title.setSingleLine(false);
Run Code Online (Sandbox Code Playgroud)