[TIMOB-4244] iOS: Enable searchBar to animate cancel button
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2012-02-17T11:33:41.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Sprint 2012-04, Release 2.0.0 |
Components | iOS |
Labels | community, parity, qe-port |
Reporter | Phil Oye |
Assignee | Blain Hamon |
Created | 2011-05-25T06:10:33.000+0000 |
Updated | 2012-08-17T04:12:41.000+0000 |
Description
When a searchBar is NOT attached to a tableView, instead attached to a view on the window, the cancel button isn't animated. Nor does there seem to be a property to enable it. The cancel button IS animated when a searchBar is attached to a tableView.
On the Q&A site, there is this:
[http://developer.appcelerator.com/question/67231/searchbar-animate-cancel-button]
Hidayet Dogan, looked at the source and wrote:
Change:
[search setShowsCancelButton:[TiUtils boolValue:value]];
to
[search setShowsCancelButton:[TiUtils boolValue:value] animated:YES];
Could be a configurable option, I suppose, but having it match the tableView searchBar would probably make sense. The latter is not configurable.
In order for us to progress this ticket, please explicitly state your environment, ie your iOS SDK and Titanium versions. Thanks
iOS SDK: 4.3.2 (8H7) Titanium 1.7.0 (presumably RC1) Titanium Studio, build: 1.0.0.201105271818
I made a pull request for it before 1.8 release. I also added option for it named "cancelAnimated". Documentation was also included. See the commit here: https://github.com/hdogan/titanium_mobile/commit/449476f042b62a221ac048795efcd6a871f7bf5d and the pull request: https://github.com/appcelerator/titanium_mobile/pull/562 But they haven't accepted it yet. I'll probably implement it using latest SDK (ie, 1.8) and attach pull request with this issue ID. They maybe notice the request at this time.
Updated pull request with latest master branch (including documentation changes). https://github.com/appcelerator/titanium_mobile/pull/1329
Hidayet - Thanks for your pull request. We will review it in next few days and get back to you if we have questions.
Signed CLA is in place.
To keep with the pattern of optional animated arguments in setters, I do want to have the following design pattern. The pull request will be up shortly, but Hidayet deserves full credit.
Blain - Please make sure that we have this feature available on both iOS and Android platforms.
Sabil - You should resolve this bug and open another bug for Android.
I highly think that iOS and Android SDKs should be splitted. iOS features which does not supported by Android platform is totally pain for future Titanium SDK about supporting platform features. Ti.iOS, Ti.iPhone and Ti.iPad namespaces is not a solution. By the way Blain's pull request seems already pushed to master branch, I think this issue can be closed.
Environment used for verification - Tested with Titanium SDK: 2.2.0.v20120816212512 Tested with Titanium Studio: 2.1.1.201207271312 Device - iOS 5.1 simulator Machine OS - MAC 10.8