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

Android: Images do not scale UP properly on Android (parity issue)

    Details

    • Story Points:
      5
    • Sprint:
      2014 Sprint 21 SDK, 2014 Sprint 22 SDK

      Description

      Problem Description

      The 320x180 image in the testcase should be scaled UP to fill the width of the window (left: 0, right: 0) with it's height automatically adjusted to maintain the image aspect ratio.

      This is exactly what happens on iOS. On android, the ImageViewHeight is contstrained to the original image height, and the image's aspect ratio is maintained, thus leaving a large unfilled area to the left and right of the image.

      Since the size is set to Ti.UI.SIZE, the expected behaviour would be that the image is scaled up to fit the full width of the ImageView and it's size adjusted upward to fit the contents of the scaled up image. Again, on iOS this expected behaviour is exactly what happens. But on Android, you get the unexpected result of an image with limited width.

      Steps to reproduce

      1. Create a new mobile project
      2. Add Android to the supported platforms
      3. Add this testcase to app.js

      var win = Ti.UI.createWindow({
      	backgroundColor:'white',
      });
       
      var TestImage = Ti.UI.createImageView({
      	image: 'http://placehold.it/320x180',
      	left: 0,
      	right: 0,
      	//height: Ti.UI.SIZE,
      	top: 40,
      	backgroundColor: '#ff0000'
      });
       
      win.add(TestImage);
       
      win.open();
      

      4. If you run this in Android, you will see red next to the image. If you run this in iOS it will be nicely filling the space, no red in the screen.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sunila Sunila
                Reporter:
                bradleycorn Brad Ball
                Reviewer:
                Ping Wang
                Tester:
                Visalakshi Chidambaram
              • Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

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

                    Git Integration