工具栏搜索未在UI中自定义

时间:2016-08-11 07:54:35

标签: css codenameone

根据this blog post,应该可以通过自定义UIID ToolbarSearchTextFieldSearch和`TextHintSearch来设置工具栏搜索的样式。

在我的CSS文件中,它看起来像这样:

ToolbarSearch {
    color: white;
    height:30mm;
    width:30mm;
}

TextHintSearch {
    color: white;
    height:30mm;
    width:30mm;
}

TextFieldSearch {
    color: white;
    height:30mm;
    width:30mm;
} 

我想要达到的主要目标是白色搜索按钮,文字,X - 按钮和提示。

在上面的博客文章中,除了textfieldsearch和-hint:

外,它看起来是正确的

enter image description here

但在我的应用程序中它看起来像这样:

enter image description here enter image description here

按钮颜色错误。我做错了什么?

注意:

这就是我添加它的方式

this.getToolbar().addSearchCommand(e -> {
    //TODO search
});

(algorythm尚未实施)

1 个答案:

答案 0 :(得分:1)

我没有使用CSS插件,因此我不确定这是如何映射的,但您需要覆盖所选/按下的&未选择的风格。