[TIMOB-25871] iOS: Add ability to hide back button on NavigationWindow
| GitHub Issue | n/a |
|---|---|
| Type | Improvement |
| Priority | Medium |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-08-27T16:25:32.000+0000 |
| Affected Version/s | Release 7.1.0 |
| Fix Version/s | Release 7.5.0 |
| Components | iOS |
| Labels | community, ios, quick-win |
| Reporter | Rene Pot |
| Assignee | Vijay Singh |
| Created | 2018-03-15T11:08:16.000+0000 |
| Updated | 2018-08-27T16:25:37.000+0000 |
Description
Natively it is possible to hide the backButton programatically using the hidesBackButton attribute. This is discussed in this StackOverflow question: https://stackoverflow.com/questions/614212/how-to-hide-back-button-on-navigation-bar-on-iphone
We should consider using this property when the user wants to hide the button.
We can expose this property as property of Window - Titanium.UI.Window.hidesBackButton
PR - https://github.com/appcelerator/titanium_mobile/pull/10043 Test Case -
var win2 = Titanium.UI.createWindow({ backgroundColor: 'red', title: 'Red Window' }); var win1 = Titanium.UI.iOS.createNavigationWindow({ window: win2 }); var win3 = Titanium.UI.createWindow({ backgroundColor: 'blue', title: 'Blue Window', }); var button = Titanium.UI.createButton({ title: 'Open Blue Window' }); button.addEventListener('click', function(){ win1.openWindow(win3, {animated:true}); }); win2.add(button); var button2 = Titanium.UI.createButton({ title: 'Open Gray Window(Back Button Hidden)' }); button2.addEventListener('click', function(){ win1.openWindow(win4, {animated:true}); }); win3.add(button2); win1.open(); var win4 = Titanium.UI.createWindow({ backgroundColor: 'gray', title: 'Gray Window', hidesBackButton: true }); var button4 = Titanium.UI.createButton({ title: 'Close Gray Window' }); win4.add(button4); button4.addEventListener('click', function(){ win1.closeWindow(win4, {animated:false}); });*Closing ticket*, Verified fix in SDK Version:
7.4.0.v20180726102127*FR Passed (Test Steps):*Created a new titanium application
Added the above code in to the
app.jsRan the program
Opened the blue window (Back button set to visible)
Back button is visible on the
NavigationWindowOpened the Gray Window (Back button is set not to be visible)
Back button is not visible on
*Test Environment*NavigationWindow