簡體   English   中英

更改SearchView提示鈦合金中的文本和圖標顏色

[英]change SearchView hint Text and icon color in titanium

我正在使用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,

    });

如何在鈦金中更改搜索視圖的提示文本和圖標顏色?

我沒有使用Alloy文件夾

嘗試使用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提供給搜索hintTextColor

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM