自定义Notification

RemoteViews remoteViews = new RemoteViews(this.getPackageName(), "自定义通知布局");
remoteViews.setTextViewText("TextView控件ID", "值");//能够设置各类控件
Notification notification = new Notification();
notification.contentView = remoteViews;//设置布局
其余与普统统知相同


如今手机各类主题,通知栏背景颜色各类,若是给通知布局TextView设置固定字体颜色可能出现字体颜色和背景相同。
因此在设置TextView的字体颜色时要给系统颜色,而不是给固定值
android:textColor="@android :color/primary_text_light"这个错了
android:textColor="?android:textColorPrimary"应该是这个java

版权声明:本文为博主原创文章,未经博主容许不得转载。android

相关文章
相关标签/搜索