Problem
When user specifies false for showControls on iOS cameraView, a black bar appears across the bottom of the page where the tab group (camera controls) used to be.
Sample Code
function CameraWindow(){
var win = Ti.UI.createWindow({
backgroundColor: 'green',
navBarHidden:true,
tabBarHidden:true
});
Ti.Media.showCamera({
success:function(event) {
win.close();
},
cancel:function() {
win.close();
},
error:function(error) {
var a = Titanium.UI.createAlertDialog({title:'Camera'});
if (error.code == Titanium.Media.NO_CAMERA) {
a.setMessage('Please run this test on device');
} else {
a.setMessage('Unexpected error: ' + error);
}
a.show();
},
showControls:false, // don't show system control
autohide:false // tell the system not to auto-hide and we'll do it ourself
});
return win;
}
(function(){
var tabGroup = Ti.UI.createTabGroup({
});
var tab = Ti.UI.createTab();
var rootWindow = RootWindow(tab);
tab.setWindow(rootWindow);
tabGroup.addTab(tab);
tabGroup.open();
})();
Desired Result
The black bar should not be shown when showControls property is set to false. The cameraView should fill up the whole screen.
link:
http://stackoverflow.com/questions/2674375/uiimagepickercontroller-doesnt-fill-screen
showControls=false should be used with overlay property (Otherwise the camera is unusable). That will automatically set a full screen transform for iPhone.
thank you for clarifying, I will tell the customer
Actually it still causes a problem if you add an overlay. If you look at the ARTi code (published through Appcelerator) you will see it working perfectly but in the code I supplied it does not...
Where is the code you supplied that has an overlay in it? I will look into this
Ivan, please link the code that you provided as it is not available through this bug ticket. Here is a link to one of my gists in which you can see a full screen camera using an overlay (https://gist.github.com/3183771). I took a look at the ARTi source code as well, which uses also uses an overlay. Please review mine/the ARTi code to see how to successfully implement an overlay. If you need any help with this please feel free to open a ticket.
Closing this ticket as it is invalid. showControls: false should only be used when an overlay is implemented
This is also happening to me in an iPhone 6+
I am getting a black bar where the controls used to be. Im using 3.5.0 GAvar overlayView = Ti.UI.createView({ width: Ti.Platform.displayCaps.platformWidth, height: Ti.Platform.displayCaps.platformHeight }); var shootButton = Ti.UI.createButton({ backgroundColor:'red', title:'shoot me', width:200, height:40 }); overlayView.add(shootButton); Titanium.Media.showCamera({ success:function(event) { Ti.API.debug('Our type was: '+event.mediaType); // event.media; }, cancel:function() {}, error:function(error) { alert('Please run this test on device'); }, saveToPhotoGallery:false, mediaTypes:[Ti.Media.MEDIA_TYPE_PHOTO], autohide:false, showControls:false, overlay:overlayView }); }; shootButton.addEventListener('click', function() { Ti.Media.takePicture(); });