大佬教程收集整理的这篇文章主要介绍了android – 如何突出显示通知中每一行的左侧文本,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
NotificationCompat.builder mBuilder = new NotificationCompat.builder(this.getApplicationContext()) .setContenTintent(contenTintent) .setsmallIcon(R.drawable.ic_notification) .setContenttitle(contenttitlE) .setDefaults(Notification.DEFAULT_SOUND) .setTicker(ticker) .setContentText(contentText); // Need BIG view? if (size > 1) { NotificationCompat.InBoxStyle inBoxStyle = new NotificationCompat.InBoxStyle(); // Sets a title for the InBox style big view inBoxStyle.setBigContenttitle(contenttitlE); for (String notificationmessage : notificationmessages) { inBoxStyle.addLine(notificationmessagE); } mBuilder.setStyle(inBoxStylE); } notificationmanager mnotificationmanager = (notificationmanager) getSystemservice(Context.NOTIFICATION_serviCE); mnotificationmanager.notify(NOTIFICATION_ID,mBuilder.build());
因此,您可以通过应用Underlinespan轻松实现所需的效果
https://developer.android.com/reference/android/text/style/UnderlineSpan.html
How to set underline text on textview?
快速编辑:
我只是意识到OP提到的亮点而不是下划线但答案仍然是相同的,OP可以选择自定义文本的几种类型的CharacterSpan:
https://developer.android.com/reference/android/text/style/CharacterStyle.html
以上是大佬教程为你收集整理的android – 如何突出显示通知中每一行的左侧文本全部内容,希望文章能够帮你解决android – 如何突出显示通知中每一行的左侧文本所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。