[TIMOB-20295] iOS: Support SearchBar button title
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Low |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-02-02T20:57:34.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.4.0 |
| Components | iOS |
| Labels | qe-.5.4.0, searchbar |
| Reporter | Marian Kucharcik |
| Assignee | Hans Knöchel |
| Created | 2016-01-31T00:20:59.000+0000 |
| Updated | 2017-05-24T18:46:13.000+0000 |
Description
Hi guys,
can you please implement new feature - abbility to change/localize SearchBar Cancel button title? It can be done in Swift/ObjC via child views of searchbar, but it's not implemented in Appcelerator/Ti SDK.
I wrote a post to StackOverflow [link here:](http://stackoverflow.com/questions/35046988/ios-appcelerator-studio-how-to-translate-cancel-button-on-searchbar/35095589#35095589)
Thank you
PR: https://github.com/appcelerator/titanium_mobile/pull/7659 Demo:
var win = Ti.UI.createWindow(); var searchBar = Ti.UI.createSearchBar({ cancelButtonTitle: "Custom" }); var list = Ti.UI.createListView({ top: 20, searchView: searchBar }); win.add(list); win.open();FT and CR approved , Thanks!
Thank you guys for your work, I'm excited to try this as soon as I can :)
Verified as fixed, SearchBar button title can now be customized. Tested On: iPhone 6S (9.3.2) Device & iPhone 6 Plus (8.3) Device Mac OSX El Capitan 10.11.5 Ti SDK: 5.4.0.v20160608165242 Appc Studio: 4.6.0.201605201934 Appc NPM: 4.2.7-2 App CLI: 5.4.0-15 Xcode 7.3 Node v4.2.6 *Closing ticket.*
I can't see this property working on titanium SDK 6.0.4. Using this code
var search = Titanium.UI.createSearchBar({ barColor: '#f0f0f0', borderColor: '#f0f0f0', cancelButtonTitle: 'Done', height: 43, left: 20, right: 20, hintText: 'Ex. "David", "Hasselhoff" or "Michael Night"', top: 30, }); }}does not show any button at all. IfshowCancel` property is set to true, it shows the Cancel button (no change in button label at all). Any thought?