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

Android: ImageView canScale property does not maintain boundary

    Details

      Description

      If the following code is run, once the image is displayed, pan the image without zooming. It can be observed that the image is going outside the viewable region and the view becomes green and the image is not longer displayed.

      It should be within the viewable region.

      var win = Titanium.UI.createWindow({
      	exitOnClose : true,
      	navBarHidden : true
      });
       
       
      var parentView = Titanium.UI.createView({
      	left : 0,
      	top : 0,
      	width : '100%',
      	height : '50%',
      	backgroundColor : 'red'
      });
       
       
      var imageView = Titanium.UI.createImageView({
      	left : 0,
      	top : 0,
      	width : Titanium.UI.SIZE,
      	height : Titanium.UI.SIZE,
      	canScale : true,
      	enableZoomControls : true,
      	backgroundColor : 'green'
      });
       
      parentView.add(imageView);
      win.add(parentView);
      win.open();
       
       
      var xhr = Titanium.Network.createHTTPClient({
      	onload : function(e) {
      		Ti.API.error("<<<<<<<<<<<<<<<<<<<<<<<<" + this.responseData);
      		imageView.image = this.responseData;
      	},
      	
      	onerror : function(e) {
      		alert('<<<Error>>>');
      		Ti.API.error("The error is: " + e.error);
      	},
      	
      	timeout : 10000,
      	autoEncodeUrl : false
      });
       
      xhr.open('GET', 'http://images4.wikia.nocookie.net/__cb20111006233206/disney/images/e/e2/MMCH_Y3.jpg');
      xhr.setRequestHeader('content-type', 'application/json');
      xhr.setRequestHeader('accept', 'application/json');
      xhr.send();
      

        Attachments

        1. Device_02.png
          Device_02.png
          70 kB
        2. Device_03.png
          Device_03.png
          21 kB
        3. Device_04.png
          Device_04.png
          14 kB
        4. Device_1.jpg
          Device_1.jpg
          31 kB

          Activity

            People

            • Assignee:
              sunila Sunila
              Reporter:
              soumyakantikar Soumya Kanti Kar
              Reviewer:
              Allen Yeung
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration