Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-12760] iOS: Media - Default Camera button is moving down the screen

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-08-18T21:56:06.000+0000
Affected Version/sRelease 3.0.2
Fix Version/sn/a
ComponentsiOS
Labelscamera, media, qe-sdk3.0.2
ReporterOlga Romero
AssigneeEric Merriman
Created2013-02-15T21:23:14.000+0000
Updated2017-08-18T21:56:06.000+0000

Description

While testing Media Module I noticed "Default Camera" button being moved down the screen. It is not regression, occurs in 3.0.0.GA. Test steps: Run test code

		// create window with vertical layout
		var win = Ti.UI.createWindow({backgroundColor:'white', layout:'vertical'});
		
		
		// create button, register the modified click callback, add button to window
		function addButton(title, clickCallback)
		{
			var button = Ti.UI.createButton({title:title, width:'300', height:'50'});
			
			button.addEventListener('click', function() {
				Ti.Media.showCamera({mediaType:Ti.Media.MEDIA_TYPE_PHOTO});
				clickCallback();
				Ti.Media.vibrate();
				});
				
			win.add(button);
		}
		
		// camera with no switch
		addButton('Default Camera', function(){
			
		});
		
		// camera with front specified
		addButton('Front Camera Test 1', function(){
			Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT);
		});
		
		// camera with front specified after switching to back
		// checks if switch function actually works, opposed to it being the default
		addButton('Front Camera Test 2', function(){
			Ti.Media.switchCamera(Ti.Media.CAMERA_REAR);
			Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT);
		});
		
		// camera with back specified
		addButton('Back Camera Test 1', function(){
			Ti.Media.switchCamera(Ti.Media.CAMERA_REAR);
		});
		
		// camera with back specified after switching to front
		// checks if switch function actually works, opposed to it being the default
		addButton('Back Camera Test 2', function(){
			Ti.Media.switchCamera(Ti.Media.CAMERA_FRONT);
			Ti.Media.switchCamera(Ti.Media.CAMERA_REAR);
		});
		
		// camera passed invalid (non-existent) argument
		addButton('Invalid Camera', function(){
			Ti.Media.switchCamera(undefined);
		});
		
		// open window
		 win.open();


2. Press "Default Camera" 3. Press Cancel and observe the button on the bottom of the screen Note: Adding 'top : 5 to the properties var button = Ti.UI.createButton({title:title, width:'300', height:'50'}); will fix this issue.

Attachments

FileDateSize
defaultcamerabutton.png2013-02-15T21:23:14.000+000039526

Comments

  1. Lee Morris 2017-08-18

    I am unable to reproduce this issue with the following environment; iPhone 6 (10.2) Studio 4.9.1.201707200100 Ti SDK 6.1.2 GA Appc CLI 6.2.3 Ti CLI 5.0.14 Alloy 1.9.13 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source