Details

      Description

      There is a problem rendering views on a camera overlay. Please find the image attached.

      Repo Steps

      1. Run the below code in app.js
      2. Tap the "Open Button" and it will open the casmera with custom overlay.
      3. First time everything looks good. Tap the close button.
      4. Again tap the "Open Button" and now you'll see the icon on the shutter button will be moved above the close button.

      /*jslint white:true plusplus:true nomen:true vars:true sloppy:true undef:false*/
       
      var win1 = Titanium.UI.createWindow();
       
      var openCameraButton = Titanium.UI.createButton({
      	title : 'Open Camera',
      	width : 120,
      	height : 40
      });
       
      win1.add(openCameraButton);
       
      var overlayView = Ti.UI.createView({
      	backgroundColor : 'transparent'
      });
       
      var closeButton = Ti.UI.createButton({
      	title : 'Close',
      	width : 60,
      	height : 40,
      	bottom : 0,
      	left : 0
      });
       
      closeButton.addEventListener('click', function() {
      	Ti.Media.hideCamera();
      });
       
      var shutterButton = Ti.UI.createButton({
      	touchEnabled : true,
      	width : 100,
      	height : 40,
      	bottom : 5
      });
      var shutterButtonIcon = Ti.UI.createImageView({
      	image : 'ShutterIcon.png',
      	width : 26,
      	height : 21
      });
       
      shutterButton.add(shutterButtonIcon);
      overlayView.add(closeButton);
      overlayView.add(shutterButton);
       
      openCameraButton.addEventListener('click', function() {
      	Ti.Media.showCamera({
      		success : function(event) {
      			Ti.API.info('Camera success event received.');
      		},
      		cancel : function(event) {
      			Ti.API.info('Camera cancel event received.', 2);
      		},
      		error : function(error) {
      			Ti.API.info('Camera error event received.', 2);
      		},
      		overlay : overlayView,
      		transform : Ti.UI.create2DMatrix(),
      		allowEditing : false,
      		saveToPhotoGallery : false,
      		mediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,
      		showControls : false,
      		autohide : false,
      		animated : true
      	});
      });
       
      win1.open();
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                vduggal Vishal Duggal (Inactive)
                Reporter:
                nsharma Nikhil Sharma
              • Watchers:
                0 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-5659
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code