1

enter image description here

i am creating a searchbar in titanium 4.1.0 sdk application,where i need to hide blue color bottom line in seaarchbar and make the color of typing letters blue color.i am using below code but there are no property called color in searchbar and how could i hide bottom line ?Please guide me in this.

var search = Titanium.UI.createSearchBar({
height : 23,
backgroundColor:'transparent',
showCancel : true,
top : 0,
softKeyboardOnFocus : Titanium.UI.Android.SOFT_KEYBOARD_HIDE_ON_FOCUS
});

var tableview = Titanium.UI.createTableView({
backgroundColor : 'transparent',
height : 'auto',
contentHeight : 'auto',
left : 10,
right :10,
search : search
});
allDroid
  • 405
  • 1
  • 10
  • 21

1 Answers1

1

First of all, for Android it's suggested to use SearchView instead since that maps to a native component on Android instead of emulating the one from iOS.

If that gives you the same result, you will have to use a custom Android theme to override the style:

Styling a SearchView in Android Action Bar

Community
  • 1
  • 1
Fokke Zandbergen
  • 3,866
  • 1
  • 11
  • 28
  • using searchview also result same so i looked for overiding using theme for searchview but i didnt find resource for titanium platform.Can u give some suggestion or link for this. – allDroid Dec 16 '15 at 03:42
  • Titanium supports Android themes in the same way you would use them in an Android Studio built app. With http://docs.appcelerator.com/platform/latest/#!/guide/Android_Themes-section-34636181_AndroidThemes-CustomThemes and Google for the related styles you should be able to come a long way. – Fokke Zandbergen Dec 16 '15 at 16:06
  • almost i am getting styles for actionbar there are no styles,parent style and item for searchview or searchbar.Thats the problem i am facing,code related to seachview Styles with there parent and item properties will be helpful – allDroid Dec 16 '15 at 16:49
  • Our [SearchView](https://github.com/appcelerator/titanium_mobile/blob/master/android/modules/ui/src/java/ti/modules/titanium/ui/widget/searchview/TiUISearchView.java#L22) is using `android.support.v7.widget.SearchView` so you can search for that on Google. Looks like it's not a simple thing, but e.g. http://stackoverflow.com/questions/27730253/how-to-style-the-cursor-color-of-searchview-under-appcompat and http://stackoverflow.com/questions/26574328/changing-edittext-bottom-line-color-with-appcompat-v7 have some info. – Fokke Zandbergen Dec 17 '15 at 10:00