Uploaded image for project: 'Appcelerator - INBOX'
  1. Appcelerator - INBOX
  2. AC-2806

Window.activity property does not exist if navBarHidden is not set

    Details

      Description

      If you create a window and do not set the navBarHidden property on it, then the activity property will not exist on the window so you cannot do things like create menus. The code below will error due to win.activity not existing. Uncomment the navBarHidden property and then rerun and the menu will successfully be created.

      var win = Ti.UI.createWindow({ 
      	backgroundColor: "#fff" 
      	//navBarHidden: true
      });
       
      win.open();
       
      Ti.API.info(win);
      Ti.API.info(win.activity);
      var activity = win.activity;
       
      activity.onCreateOptionsMenu = function(e){
        var menu = e.menu;
        var menuItem = menu.add({ title: "Item 1" });
        menuItem.addEventListener("click", function(e) {
          Ti.API.debug("I was clicked");
        });
      };
      

        Attachments

          Activity

            People

            • Assignee:
              mpmiranda Mauro Parra-Miranda
              Reporter:
              jtoth Justin Toth
            • Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Integration