Search code examples
javascriptiphoneviewtitaniumappcelerator

Titanium.Media.showCamera with overlay, pass through events


I am writing an iOS application that utilizes the camera. I want an image (and ultimately a control element or two) overlayed over the camera picture.

This already works. However the overlay prevents the default control elements for Flash, HDR and camera selection from receiving touch events.

Below is my code. Is there a way to make myOverlay pass through or ignore events?

var overlayImage = Titanium.UI.createImageView({
    width: 100,
    height: 100,
    backgroundImage: 'img/picture.png'
});
var myOverlay = Titanium.UI.createView();
myOverlay.add(overlayImage);

Titanium.Media.showCamera({
    success: successMethod,
    error: errorMethod,
    cancel: function(e) {},
    overlay: myOverlay,
    saveToPhotoGallery: true,
    allowEditing: false,
    mediaTypes: ['public.image']
});

Solution

  • You can try var myOverlay = Titanium.UI.createView({touchEnabled: false}); and it should pass events according to the Appcelerator docs.