Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-17748

iOS8: Camera overlay rotates on app locked in portrait orientation mode

    Details

    • Type: Bug
    • Status: Closed
    • Priority: None
    • Resolution: Invalid
    • Affects Version/s: Release 3.3.0, Release 3.4.0
    • Fix Version/s: None
    • Component/s: iOS
    • Labels:
    • Environment:

      Description

      Problem Description

      Camera overlay on iPad rotates in an app that is locked in portrait mode.
      Expected: Camera overlay should stay in portrait mode

      Steps to reproduce

      1. Create a new mobile project (classic titanium)
      2. Paste this to app.js

      app.js

      var win = Titanium.UI.createWindow({
      	backgroundColor : '#fff',
      	layout : 'vertical'
      });
       
      var frmcamera = Ti.UI.createButton({
      	backgroundColor : '#ff0000',
      	title : 'Open Camera',
      	color : '#fff',
      	width : Ti.UI.SIZE,
      	height : Ti.UI.SIZE,
      	top : 30
       
      });
       
      frmcamera.addEventListener('click', function() {
      	fireUpTheCamera();
      });
       
      win.add(frmcamera);
       
       
      var overlay = Ti.UI.createView({
      	width : 50,
      	height : 50,
      });
      // Create an ImageView.
      var overlayImg = Ti.UI.createImageView({
      	image : '/KS_nav_ui.png',
      	width : Ti.UI.SIZE,
      	height : Ti.UI.SIZE,
      	autorotate : true,
      });
       
      overlayImg.addEventListener('click', function() {
      	Ti.Media.takePicture();
      });
      overlay.add(overlayImg); 
       
       
      function fireUpTheCamera() {
      	Titanium.Media.showCamera({
       
      		success : function(event) {
       
      		},
      		cancel : function() {
      		},
      		error : function(error) {
       
      		},
      		saveToPhotoGallery : true,
      		allowEditing : false,
      		overlay : overlay,
      		mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO]
      	});
      }
       
      win.open();
      
      

      3. Set tiapp.xml

      tiapp.xml

       <iphone>
          <orientations device="ipad">
              <orientation>Ti.UI.PORTRAIT</orientation>
          </orientations>
          <orientations device="iphone">
              <orientation>Ti.UI.PORTRAIT</orientation>
          </orientations>
      </iphone>
      

      4. Test in a device

        Attachments

          Activity

            People

            • Assignee:
              emerriman Eric Merriman
              Reporter:
              mukundsamant89@gmail.com Mukund Samant
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-19251
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration