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

TiAPI: Add "scalingMode" property to Ti.UI.ImageView

    Details

    • Story Points:
      7

      Description

      Summary:
      Add ability to control how Ti.UI.ImageView scales its image. In particular, developers want the ability to crop the image.

      Proposed Solution:
      Add a new "scalingMode" property to Ti.UI.ImageView supporting the following constants...

      • Ti.Media.IMAGE_SCALING_AUTO // Legacy behavior.
      • Ti.Media.IMAGE_SCALING_NONE // No scaling. Show image as-is.
      • Ti.Media.IMAGE_SCALING_FILL // Stretches image disproportionally.
      • Ti.Media.IMAGE_SCALING_ASCPECT_FILL // Crops proportionally.
      • Ti.Media.IMAGE_SCALING_ASCPECT_FIT // Letterbox/Pillarbox proportionally.

      The above property name and scaling constants match the names used by our Ti.Media.VideoPlayer for consistency.
      https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer-property-scalingMode

      Future:
      In the future, we could add properties "horizontalAlignment" and "verticalAlignment" to control where the image should be aligned to within the image view container. For now, we should only support center alignment since that would satisfy most developers.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jquick Joshua Quick
                Reporter:
                kopiro Flavio De Stefano
                Reviewer:
                Gary Mathews
              • Watchers:
                14 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                    Git Integration