Manuel_Rodrigues
Manuel_Rodrigues

Reputation: 560

chance text of search bar in titanium

i'm developing an app for Android and IOS in titanium and a need a search bar. in IOS it works fine. the background is white and the text is black but in android the text has the same color as the background (white) so it does not apear.

this is my search bar:

var searchBar = Titanium.UI.createSearchBar({
    barColor : '#FFFFFF',
    backgroundColor : 'transparent',
    borderRadius : 3,
    borderColor : 'black',
    height : 43,
    focusable : true,
    softKeyboardOnFocus : true,
    width : 300,
    top : deviceHeight * 0.12
})

how can i change the text color so it is black in android and IOS?

i'm not using the alloy folder

Upvotes: 0

Views: 385

Answers (1)

Hazem Khaled
Hazem Khaled

Reputation: 106

With Android better to use SearchView not SearchBar http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.Android.SearchView

It's Appc recommendation

The SearchBar object is closely modeled on an iOS native search bar. As such, not all features are supported on other platforms. For Android applications, consider using a Titanium.UI.Android.SearchView object instead. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.SearchBar

Upvotes: 0

Related Questions