我已经创建了一个应用程序来测试新的 CN1 CSS 支持。
这个插件很棒,一切正常,开箱即用,除了按钮上的 Material 图标不会随着按钮的文本颜色而改变其颜色。它只是始终保持相同的(黑色)颜色。
在使用 CSS 支持之前,我更改了主题编辑器的默认前景色设置以达到 Material 图标,但现在主题编辑器似乎与样式分离并且不再有任何效果。
是否有图标的 UIID 或任何其他方式来更改 Material 图标的颜色?
这是我的代码:
FontImage icon = FontImage.createMaterial(FontImage.MATERIAL_CHECK, "TitleCommand", 3);
Button buttonTest = new Button("Test css");
buttonTest.setUIID("ButtonTest");
buttonTest.setIcon(icon);
还有 CSS:
ButtonTest {
color: red;
}
最佳答案
尝试一下
FontImage img = FontImage.createMaterial(FontImage.MATERIAL_THUMB_UP, style);
关于css - Codename One CSS Material Icon 颜色不变,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50390418/