在概述(最近的应用程序)屏幕中设置应用程序的标题颜色 [英] Setting header color of app in overview (recent apps) screen
本文介绍了在概述(最近的应用程序)屏幕中设置应用程序的标题颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在向应用程序添加一些仅棒棒糖风格.
I'm adding some Lollipop-only styling to an app.
我想在此处更改Gmail概述屏幕中标题的颜色:
I want to change color of header in overview screeen like Gmail here:
我已经知道我能做到
<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:colorPrimary">@color/my_favorite_color</item>
</style>
要实现它,但是我只想为这种情况指定颜色,就像我可以做到的那样:
to achieve it, but I would want to specify only the color for this case, just like I can do:
<item name="android:statusBarColor">@color/my_favorite_color<item>
是否有用于设置标题颜色的特定属性?
Is there a specific attribute to set header's color?
侧面问题:图标和标题也可以更改吗?
Side question: can icon and title be also changed?
推荐答案
您可以通过ActivityManager.TaskDescription
进行更改:
https://developer.android.com/reference/android/app/ActivityManager.TaskDescription .html
在活动"上下文中,调用:
From an Activity context, call:
TaskDescription taskDescription = new TaskDescription(label, icon, colorPrimary);
((Activity)this).setTaskDescription(taskDescription);
这篇关于在概述(最近的应用程序)屏幕中设置应用程序的标题颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文