[TIMOB-20302] iOS: Support showing and hiding the toolbar in Ti.UI.Window
| GitHub Issue | n/a |
|---|---|
| Type | New Feature |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2016-02-15T08:58:27.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 5.4.0 |
| Components | iOS |
| Labels | ios, qe-5.4.0, toolbar, window |
| Reporter | Hans Knöchel |
| Assignee | Hans Knöchel |
| Created | 2016-02-02T10:22:37.000+0000 |
| Updated | 2016-06-09T23:16:42.000+0000 |
Description
There is a [community PR](https://github.com/appcelerator/titanium_mobile/pull/6816) to support hiding and showing the toolbar on iOS (toolbars are not available on Android, yet).
Currently the docs and example code are missing, I will assist the community member to cherry-pick his changes and add the docs and test case in a new PR.
PR: https://github.com/appcelerator/titanium_mobile/pull/7725 (Unit tests included) Demo:
var win = Ti.UI.createWindow({backgroundColor: 'white'}); var nav = Ti.UI.iOS.createNavigationWindow({window: win}); var isHidden = false; var btn = Ti.UI.createButton({ top: 100, title : "Hide toolbar" }); btn.addEventListener("click", function() { if (isHidden === true) { win.showToolbar(); } else { win.hideToolbar(); } btn.setTitle(isHidden ? "Hide toolbar" : "Show toolbar"); isHidden = !isHidden; }); win.add(btn); win.setToolbar([ Ti.UI.createButton({title: "Toolbar"}) ], { animated: false }); nav.open();APPROVED! PR merged!
Verified as fixed, toolbar can be hidden and shown. Tested On: iPhone 6S (9.3.2) 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-11 Xcode 7.3 Node v4.2.6 *Closing ticket.*