Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2096] Android camera preview not full screen width when using overlay

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2013-08-06T21:26:14.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsandroid, camera
ReporterAlex Bernier
AssigneeShak Hossain
Created2013-08-06T01:29:24.000+0000
Updated2016-03-08T07:41:04.000+0000

Description

*Problem* When using an overlay with showCamera, the preview (where you see what the camera sees) doesn't stretch to the whole width of the screen. There is a ~5-10dp black bar on the left and right side of the preview screen. The overlay view, however, does takes up the entire width of the screen. *Test case* Notice the red bar will be the entire width of the screen and the preview will stop short on the left and right.
var win = Ti.UI.createWindow({
	backgroundColor : "#FFF"
});

var overlay = Ti.UI.createView({
	backgroundColor : "transparent",
	height : Ti.UI.FILL,
	width : Ti.UI.FILL
});

overlay.add(Ti.UI.createView({
	backgroundColor : "red",
	height : 20,
	width : Ti.UI.FILL
}));

win.addEventListener('click', function() {
	Titanium.Media.showCamera({
		overlay : overlay,
		saveToPhotoGallery : false,
		allowEditing : false,
		mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],
		showControls : false,
		autohide : false
	});
});

win.open();

Comments

  1. Daniel Sefton 2013-08-06

    Closing as duplicate of TIMOB-14764.

JSON Source