Ti.UI.setBackgroundColor('#ffffff');
var homeWindow = Titanium.UI.createWindow
({
});
homeWindow.open();
var displayVoucherOverlayView = Ti.UI.createView
({
top: 0,
bottom: 0,
left: 0,
right: 0,
opacity: 0.75
});
var setAButton = Ti.UI.createButton
({
top: 100,
left: 30,
right: 30,
height: 75,
title: "HELLO"
});
displayVoucherOverlayView.add(setAButton);
setAButton.addEventListener('click', function() { alert("I HAVE BEEN PRESSED");} );
var navigationBar = Ti.UI.createView
({
bottom: 0,
height: 50,
right: 0,
backgroundColor: "#000000",
opacity: 0.75
});
var navBarTestBtn = Ti.UI.createView
({
left: 5,
width: 90,
height: 50,
top: 0,
backgroundColor: "#000000",
borderColor: "#FFFFFF",
borderWidth: 2
});
var navBarTestBtnText = Ti.UI.createLabel
({
width: 90,
text: "TEST",
color: "#FFFFFF",
textAlign: 'center',
font: {fontSize: 10}
});
navBarTestBtn.add(navBarTestBtnText);
navigationBar.add(navBarTestBtn);
navBarTestBtn.addEventListener('click', function() {alert("IM A VIEW WITH A LISTENER");} );
displayVoucherOverlayView.add(navigationBar);
var cameraTransform = Ti.UI.create2DMatrix();
cameraTransform = cameraTransform.scale(2);
Ti.Media.showCamera
({
success: function(event) {},
cancel: function() {},
error: function(error)
{
if (error.code == Ti.Media.NO_CAMERA)
{
alert("NO CAMERA");
}
else
{
alert("CAMERA ERROR");
}
},
mediaTypes: [Ti.Media.MEDIA_TYPE_VIDEO,Ti.Media.MEDIA_TYPE_PHOTO],
showControls: false,
autohide: false,
transform: cameraTransform,
overlay: displayVoucherOverlayView
});
Camera image appears stretched and blurry. Image taken looks fine.
Sent [PR #2081](https://github.com/appcelerator/titanium_mobile/pull/2081) to address the issue. Disable a bit of code which was overriding the camera preview size resulting in the poor quality image preview.
Tested on: Titanium Studio, build: 2.1.0.201206221045 Titanium SDK: 2.1.0.v20120622174154 Device: Samsung Galaxy tab (3.2) Camera view is still stretched.
Created [PR #2507](https://github.com/appcelerator/titanium_mobile/pull/2507) to resolve issue.
tested on HTC Desire (2.2) HTC Sensation (2.3) Asus Transformer TF101 (3.1) Motorola Xoom (4.0.3) Samsung Galaxy Nexus (4.1)
Verified fixed with mobile sdk-2.2.0.v20120810080115 Titanium Studio, build: 2.1.1.201207271312 Device: Galaxy S III Android version 4.0.4