我试图让我的 Android Wear 通知的标题显示超过 2 行(或更多行)而不是总是 1 行。Here是我想要的例子,但是 here这就是它现在正在做的。我正在使用
NotificationCompat.Builder.setContentTitle(CharSequence title)
记录在案here .我试过插入换行符和/或回车符,它适用于通知中的文本,但不适用于标题。我需要某种方式让标题自动换行,或者某种方式让它识别换行符。 谢谢
最佳答案
我认为大文本是您想要的。
Notification notif = new Notification.Builder(mContext)
.setContentTitle("New mail from " + sender.toString())
.setContentText(subject)
.setSmallIcon(R.drawable.new_mail)
.setLargeIcon(aBitmap)
.setStyle(new Notification.BigTextStyle()
.setBigContentTitle(aVeryLongString))
.build();
关于Android Wear - 通知标题格式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25123225/