Implement the hintText property for SearchBar. Demo code below
var win = Ti.UI.createWindow();
var searchWithHintText = Ti.UI.createSearchBar({
hintText: 'Search...',
color: "#333",
top: 250,
width: 300,
backgroundColor: "#fff"
});
var searchWithoutHintText = Ti.UI.createSearchBar({
color: "#333",
top: 300,
width: 300,
backgroundColor: "#fff"
});
var setMethBtn = Ti.UI.createButton({
title: 'Set the hintText via method',
top: '15'
});
var setPropBtn = Ti.UI.createButton({
title: 'Set the hintText via prop',
top: 50
});
setMethBtn.addEventListener('click', function () {
searchWithHintText.setHintText('Changed search text via method');
});
setPropBtn.addEventListener('click', function () {
searchWithHintText.hintText = 'Changed search text via prop';
});
var getBtn = Ti.UI.createButton({
title: 'Get the hintText',
top: 150
});
getBtn.addEventListener('click', function () {
console.log(searchWithHintText.hintText);
console.log(searchWithHintText.getHintText());
});
win.add(setMethBtn);
win.add(setPropBtn);
win.add(getBtn);
win.add(searchWithHintText);
win.add(searchWithoutHintText);
win.open();
Master PR: https://github.com/appcelerator/titanium_mobile_windows/pull/1010
Verified improvement in SDK Version: 6.2.0.v20170626084207. Test and other information can be found at: https://github.com/appcelerator/titanium_mobile_windows/pull/1010