如何更改应用程序背景的标题颜色?
How to change the title color of app background?
如图所示,APP的标题在进入背景后会变成红色,但不是所有的phones.Do有谁知道如何改变这个颜色吗?
很简单,转到 res/values/colors.xml
文件并将 colorPrimary
更改为您想要的颜色:
<color name="colorPrimary">YOUR_REQUIRED_COLOR_HERE</color>
如果你需要在JAVA
,你也可以使用@mohammadRezaAbiri 给出的答案:
Bitmap bm = BitmapFactory.decodeResource(getResources(), app_icon);
TaskDescription taskDesc = new TaskDescription(getString(R.string.app_name), bm, getResources().getColor(R.color.primary_600));
MainActivity.setTaskDescription(taskDesc);
如图所示,APP的标题在进入背景后会变成红色,但不是所有的phones.Do有谁知道如何改变这个颜色吗?
很简单,转到 res/values/colors.xml
文件并将 colorPrimary
更改为您想要的颜色:
<color name="colorPrimary">YOUR_REQUIRED_COLOR_HERE</color>
如果你需要在JAVA
,你也可以使用@mohammadRezaAbiri 给出的答案:
Bitmap bm = BitmapFactory.decodeResource(getResources(), app_icon);
TaskDescription taskDesc = new TaskDescription(getString(R.string.app_name), bm, getResources().getColor(R.color.primary_600));
MainActivity.setTaskDescription(taskDesc);