Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2303] iOS: BackButton disapears when barImage is redefined

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionCannot Reproduce
Resolution Date2013-04-05T23:49:25.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
LabelsBackbutton, barImage, ios, orientation
ReporterMads Moller
AssigneeMauro Parra-Miranda
Created2012-12-04T13:32:33.000+0000
Updated2016-03-08T07:41:19.000+0000

Description

I have a orientation listener that swaps out the barImage of the navGroup when orientation is changed. This works great. BUT: when pressing the backbutton, and Back Button is gone in every new window I open. If I comment out this orientationchange listener, then the backButton appears as normal. Its not a custom backbutton.
Ti.Gesture.addEventListener('orientationchange', orientationHandler);
function orientationHandler(e){
	switch(e.orientation){
        case Ti.UI.PORTRAIT:
        case Ti.UI.UPSIDE_PORTRAIT:
        	window.setBarImage("/images/header.png");
        break;
        case Ti.UI.LANDSCAPE_LEFT:
        case Ti.UI.LANDSCAPE_RIGHT:
        	window.setBarImage("/images/header_wide.png");
        break;
        case Ti.UI.UNKNOWN:
        default:
            // do nothing
        break;
	}
}

Comments

  1. Pedro Enrique 2013-04-05

    Tested the following code with Titanium 3.0.2.GA
       var win = Ti.UI.createWindow({
           modal: true,
           orientationModes:[1,2,3,4],
           backgroundColor: 'white',
       
       });
       
       win.setBarImage("KS_nav_ui.png");
       
       Ti.Gesture.addEventListener('orientationchange', orientationHandler);
       function orientationHandler(e){
           switch(e.orientation){
               case Ti.UI.PORTRAIT:
               case Ti.UI.UPSIDE_PORTRAIT:
                   win.setBarImage("KS_nav_ui.png");
               break;
               case Ti.UI.LANDSCAPE_LEFT:
               case Ti.UI.LANDSCAPE_RIGHT:
                   win.setBarImage("KS_nav_views.png");
               break;
               case Ti.UI.UNKNOWN:
               default:
                   // do nothing
               break;
           }
       }
       win.open();
       
  2. Mauro Parra-Miranda 2013-11-22

    Can't reproduce with 3.1.3.

JSON Source