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

iOS / Android: Expose aspectFill option to Ti.UI.ImageView

    Details

      Description

      Added a boolean value to use aspect fill algorithm in the Image Views.

      With this option you can finally mimic the "background-size: cover" feature like in HTML/CSS3.

      Example code:

      var win = Ti.UI.createWindow({
          backgroundColor: '#fff'
      });
       
      var img = Ti.UI.createImageView({
      	image: 'http://lorempixel.com/800/300/sports/1/',
      	width: 300,
      	height: 300,
      	borderWidth: 1,
      	borderColor: "#000",
      	aspectFill: true
      });
      win.add(img);
       
      win.open();
      

      PR: https://github.com/appcelerator/titanium_mobile/pull/8755

        Attachments

          Activity

            People

            • Assignee:
              vijaysingh Vijay Singh
              Reporter:
              kopiro Flavio De Stefano
            • Watchers:
              12 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code