如何更改codenameone android应用程序中状态栏的颜色?
问题描述:
我想更改状态栏的颜色以匹配我的应用背景,我该怎么做?
I would like to change the color of the status bar to match my app background, how can I do this?
答
可以将colors.xml文件放在CN1项目< project> / native / android
目录下,并附带以下示例内容:
It is possible by placing a colors.xml file under the CN1 project <project>/native/android
directory with the following example content:
<resources>
<color name="colorPrimary">#ffffc003</color>
<color name="colorPrimaryDark">#ffffc003</color>
<color name="colorAccent">#ff009486</color>
</resources>
在这种情况下,colorPrimaryDark是您想要为状态栏着色的颜色
Where in this case the colorPrimaryDark is the color you would like to color the status bar