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

Android: ImageView within ScrollView does not resize correctly

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Environment:

      Android 2.3.3, 4.2
      TiSDK 3.1.3.GA, 3.1.0GA

      Description

      When creating an imageView where the image is too large for the imageView, it is expected to resize, when setting the width, and SIZE for height.

      This works fine, then the imageView is added directly to the window. But if the imageView is added to a scrollView, then it fails to resize.

      WORKS: (see: correct.png)

      var win = Ti.UI.createWindow({
      	backgroundColor : "#FFF",
      	fullscreen : false
      });
      var imageView = Ti.UI.createImageView({
      	image : "http://www.menucool.com/slider/prod/image-slider-4.jpg",
      	preventDefaultImage : true,
      	width : "320dp",
      	height : Ti.UI.SIZE
      });
      win.add(imageView);
      

      DOES NOT WORK: (see wrong.png)

      var win = Ti.UI.createWindow({
      	backgroundColor : "#FFF",
      	fullscreen : false
      });
      var scrollView = Ti.UI.createScrollView();
      var imageView = Ti.UI.createImageView({
      	image : "http://www.menucool.com/slider/prod/image-slider-4.jpg",
      	preventDefaultImage : true,
      	width : "320dp",
      	height : Ti.UI.SIZE
      });
      scrollView.add(imageView);
      win.add(scrollView);
      

      Steps to reproduce

      • create new project
      • paste above code
      • run on android

        Attachments

          Activity

            People

            • Assignee:
              ingo Ingo Muschenetz
              Reporter:
              viezel Mads Moller
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration