android - 我可以省略对话框标题吗?

标签 android dialog title

我有一个 Activity 作为 Theme.Dialog 运行。我可以将其标题设置为“椭圆形”样式吗?目前,文本是通过 setText() 在 onCreate() 中填充的。没有像 TextView 上的 this.setEllipsize() 。

或者,是我唯一的选择写a Custom Dialog并在那里设置标题样式?在走上这条路之前我想知道这是否可能。

最佳答案

干净简单,无需任何自定义 View :

TextView tv = (TextView) dialog.findViewById(android.R.id.title);
tv.setEllipsize(TextUtils.TruncateAt.END);

关于android - 我可以省略对话框标题吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3406587/

相关文章:

c# - 如何在unity 3d中单击对象时创建对话框并显示它?

html - 在最小化浏览器期间,网格标题将隐藏在 p-dialog 中

android - NDK c++ 从文件 Android 加载着色器

android - 无法从 View 转换为相对布局

android - 如何使我的表单在 Android 中可滚动?

linux - 对话框:执行选项后显示菜单

properties - 属性标题复制属性与从 MKAnnotation 继承的属性不匹配

javascript - 为什么 facebook 将 id ="pageTitle"添加到他们每个页面的页面标题中?

matlab - 在 MATLAB 中获取当前图形的标题?

Android c2dm 302 Http错误