【问题标题】:change SearchView hint Text and icon color in titanium在钛中更改 SearchView 提示文本和图标颜色
【发布时间】:2016-03-30 09:25:57
【问题描述】:

我正在使用 android 的搜索视图,但是当搜索视图为空时,很难看到搜索的图标。所以现在用户很难知道盒子的费用是多少,因为图标是白色的,而背景的颜色几乎相同。

这是我的搜索视图:

var search = Ti.UI.Android.createSearchView({
        top : (deviceHeight * 0.095) + 10,
        width : 300,
        height : 43,
        hintText : "Table Search",
        color : 'black',
        borderColor : 'black',
        borderRadius : 3,

    });

如何更改钛中搜索视图的提示文本和图标颜色?

我没有使用合金文件夹

【问题讨论】:

  • 您可以使用自定义主题更改提示文本颜色。

标签: android android-layout titanium titanium-mobile searchview


【解决方案1】:

尝试用Ti.UI.createSearchBar 代替Ti.UI.Android.createSearchView

var search = Ti.UI.createSearchBar({
    top : '100dp',
    width : '300dp',
    height : '43dp',
    hintText : "Table Search",
    hintTextColor : 'red',
    color : 'black',
    borderColor : 'black',
    borderRadius : 3,
    // value : 'def'
});
Window.add(search);

在此您可以将hintTextColor 提供给搜索栏。

【讨论】:

    猜你喜欢
    • 2013-08-18
    • 2021-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-06
    相关资源
    最近更新 更多