Android 5.0: howto change Overview Screen Task Title background color

て烟熏妆下的殇ゞ 提交于 2019-12-12 07:51:57

问题


The new Android 5.0 Lollipop Overview Screen features each App's Task with a screenshot and a (by default) grey title bar.

Some Lollipop Apps (For example the new Play Store) use different colours. How can the colour of the Overview Screen title background be changed?


回答1:


In general, if you're targeting Material then you should set colorPrimary (action bar, recents), colorPrimaryDark (status bar), and colorAccent (check boxes, progress bars, etc) in your theme.

That said, you can dynamically change the recents color to be something else using:

TaskDescription taskDesc = new TaskDescription(myTitle, myIcon, myColor);
myActivity.setTaskDescription(taskDesc);


来源:https://stackoverflow.com/questions/26496172/android-5-0-howto-change-overview-screen-task-title-background-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!