Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20295] iOS: Support SearchBar button title

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2016-02-02T20:57:34.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.4.0
ComponentsiOS
Labelsqe-.5.4.0, searchbar
ReporterMarian Kucharcik
AssigneeHans Knöchel
Created2016-01-31T00:20:59.000+0000
Updated2017-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

Comments

  1. Hans Knöchel 2016-02-01

    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();
       
  2. Angel Petkov 2016-02-02

    FT and CR approved , Thanks!
  3. Marian Kucharcik 2016-02-03

    Thank you guys for your work, I'm excited to try this as soon as I can :)
  4. Harry Bryant 2016-06-10

    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.*
  5. Javier Rayon 2017-05-24

    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. If showCancel` property is set to true, it shows the Cancel button (no change in button label at all). Any thought?

JSON Source