Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Should ImageView scale automatically?

I am using an ImageView in a TableViewRow. The ImageView references an image via a URL, and the proportions are set to 50x50. On the iphone, the image is scaled down to fit the 50x50 dimensions, but on Android, no scaling occurs.

Is image scaling available on Android?

— asked April 8th 2010 by Ryan Huff
  • android
  • imageview
1 Comment
  • Please mark this question as answered

    — commented July 12th 2011 by Julian Lindblad

4 Answers

  • Can you try setting canScale true?

    — answered April 8th 2010 by Don Thorp
    permalink
    0 Comments
  • Thanks Don, I'll give it a try in a bit. I didn't see that in the docs though. Are the online docs out of date?

    — answered April 8th 2010 by Ryan Huff
    permalink
    0 Comments
  • canScale did the trick. Thanks! Where is the best place to look for this type of info?

    — answered April 8th 2010 by Ryan Huff
    permalink
    1 Comment
    • Doesn't work on the iPhone yet. I need this. So far the only way I've found maintains aspect ratio in the transformation. Everything is proportional and the behavior interesting. I have 1024x768 image. I have a 320x410 display. If I do width=320, height=600 the api uses the width parameter and ignores height. If I do width=600, height=410 it uses the the height parameter. In both cases maintains aspect ratio. ???

      — commented October 26th 2010 by Steven Day
  • I've added Ticket 758 to get the docs updated. The expectation may be different and it might be a bug for Android in addition to the docs.

    — answered April 8th 2010 by Don Thorp
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.