Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10119] iOS: CameraView: showControls: false leaves a black bar across bottom of screen

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionInvalid
Resolution Date2012-07-30T11:41:01.000+0000
Affected Version/sRelease 2.1.0
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterCarter Lathrop
AssigneeNeeraj Gupta
Created2012-07-24T12:10:20.000+0000
Updated2015-02-27T02:34:38.000+0000

Description

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

Comments

  1. Vishal Duggal 2012-07-25

    showControls=false should be used with overlay property (Otherwise the camera is unusable). That will automatically set a full screen transform for iPhone.
  2. Carter Lathrop 2012-07-26

    thank you for clarifying, I will tell the customer
  3. Ivan Markovic 2012-07-26

    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...
  4. Carter Lathrop 2012-07-26

    Where is the code you supplied that has an overlay in it? I will look into this
  5. Carter Lathrop 2012-07-30

    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.
  6. Carter Lathrop 2012-07-30

    Closing this ticket as it is invalid. showControls: false should only be used when an overlay is implemented
  7. Michael Gangolf 2014-10-10

  8. Francisco Tirado 2015-02-27

    This is also happening to me in an iPhone 6+
       
       var 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();
       });
       
    I am getting a black bar where the controls used to be. Im using 3.5.0 GA

JSON Source