2014-01-29 28 views
0

我一直在這個問題上好幾個小時沒有運氣。我的設置很簡單:我有一個TableView與搜索欄被稱爲像這樣:如何使用Titanium刪除Android中的橙色邊框?

var tableviewMainProducts = Titanium.UI.createTableView({ 
    data : dataProducts, 
    search : search, 
    searchHidden : true, 
    top : '0dp' 
}); 

,代碼爲searchBar

var search = Titanium.UI.createSearchBar({ 
    barColor : '#CCC', 
    showCancel : false, 
    hintText : 'search' 
}); 

我已經是測試上時的問題Android我在searchBar周圍看到了一個橙色邊框,我試圖在沒有運氣的情況下將其刪除。

它看起來像有一個Android的backgroundFocusedColor但這不適合我。

任何提示如何刪除橙色的邊界將深受讚賞。

回答

1

您不能從搜索欄中刪除邊框。你可以做的是使用textField創建一個自定義搜索欄。爲搜索欄創建一個視圖,創建一個textField並將其添加到視圖中。然後爲texField設置backgroundColorbackgroundImageenter image description here

下面是一個例子

var txtSearch = Ti.UI.createTextField({ 
    hintText : 'My hint text', 
    width  : '75%', 
    top : '5%', 
    backgroundColor : 'transparent'//or backgroundColor : 'white' 
}); 

希望它可以幫助你

+0

您好阿南德,非常感謝。我想知道你的方法如何使這個新的TextField在TableView中以SearchBar的方式工作?我只是在搜索字段中調用它?非常感謝! – JordanBelf

+0

要使文本字段成爲搜索字段,您必須搜索文本字段更改事件中的值。您可以使用http://stackoverflow.com/questions/18629345/auto-suggest-dropdown-in-titanium-example/18632608#18632608的幫助 – Anand

相關問題