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

Adding A View to a window is crashing Using CommonJS

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Invalid
    • Affects Version/s: Appcelerator Studio 4.3.0
    • Component/s: Appcelerator Modules
    • Labels:
    • Environment:

      MacOS Sierra,
      Appc studio - latest
      SDK 6.0.2GA

      Description

      Hi I am having this code

      exports.alarmPicker = function(args) {
      var that = this;
      var param = args;
      var alarmPicker = Ti.UI.createPicker(

      { selectionIndicator : true, bottom : 0, left : 0, right : 0, type : Ti.UI.PICKER_TYPE_DATE_AND_TIME }

      );

      alarmPicker.addEventListener('change', function(e)

      { Ti.API.info(JSON.stringify(e)); }

      );

      var transparent = Ti.UI.createView(

      { top : 0, height : Ti.UI.FILL, width : Ti.UI.FILL, backgroundColor : 'transparent', zIndex : 2 }

      );
      var transparentGradientView = Ti.UI.createView(

      { top : 0, height : Ti.UI.FILL, width : Ti.UI.FILL, backgroundColor : 'gray', opacity : 0.6 }

      );

      transparent.add(transparentGradientView);

      transparent.add(alarmPicker);

      var alarmTitle = Titanium.UI.createLabel(

      { text : L('alarmTitleLabelText', 'Alarm'), color : '#000000' }

      );
      var toolBar = undefined;
      var set = undefined;
      var cancel = undefined;

      if (OS_IOS) {
      set = Titanium.UI.createButton(

      { title : L('setPickerTitle', 'Set'), style : Titanium.UI.iOS.SystemButtonStyle.DONE, }

      );

      cancel = Titanium.UI.createButton(

      { systemButton : Titanium.UI.iOS.SystemButton.CANCEL, title : L('cancelPickerTitle', 'Cancel') }

      );

      var flexSpace = Titanium.UI.createButton(

      { systemButton : Titanium.UI.iOS.SystemButton.FLEXIBLE_SPACE }

      );

      toolbar = Titanium.UI.iOS.createToolbar(

      { items : [cancel, flexSpace, alarmTitle, flexSpace, set], bottom : 0, borderTop : true, borderBottom : false }

      );
      } else {
      set = Titanium.UI.createButton(

      { title : L('setPickerTitle', 'Set'), right : '20dp', color : '#167AFF', backgroundColor : 'transparent' }

      );

      cancel = Titanium.UI.createButton(

      { title : L('cancelPickerTitle', 'Cancel'), left : '20dp', color : '#167AFF', backgroundColor : 'transparent' }

      );

      toolbar = Titanium.UI.createView(

      { height : 50, width : Ti.UI.FILL, backgroundColor : '#EAEAEA' }

      );

      toolbar.add(cancel);
      toolbar.add(alarmTitle);
      toolbar.add(set);

      }
      transparent.add(toolbar);

      cancel.addEventListener('click', function(e)

      { that.remove(); args.alarmSwitch.value = 0; args.alarmLabel.setVisible(false); args.alarmLabel.setText(''); }

      );

      set.addEventListener('click', function(e)

      { param.callback(alarmPicker.value); that.remove(); }

      );

      toolbar.addEventListener('postlayout', function(e)

      { this.bottom = alarmPicker.size.height; }

      );

      this.remove = function(e)

      { args.window.remove(transparent); }

      ;

      this.add = function(e)

      { args.window.add(transparent); }

      ;
      };

      When i am calling .add method i am getting the crash attached.

      This seems to be a bug and is critical

        Attachments

          Activity

            People

            • Assignee:
              shossain Shak Hossain
              Reporter:
              ishansingh20132012 Ishan Singh
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Git Source Code