Resizing/Scaling an Imageview in MobileWeb NON-proportionally?

You must Login before you can answer or comment on any questions.

Am I crazy, or is there no way currently (Mobile SDK 2.1.3) to non-proportionally resize/scale an ImageView in a Mobile Web deployment? I've tried setting width/height - and it always seems to scale proportionally no matter what I do - and if it does not fit in the view, it will scale it smaller too (unless it's the backgroundImage in which case it will get cut off but still proportionally scaled).

Is this a current limitation in the SDK?

1 Answer

It's currently not possible for an ImageView on any Titanium supported platform to distort an image from it's original aspect ratio.

— answered 7 months ago by Chris Barber
answer permalink
2 Comments
  • Weird - my current project does seem to scale imageViews non-proportionately on Android when I set their width and height... or am I seeing things wrong? I'm trying to get the same project compiled for MobileWeb (HTML5) and technically need the scaling to happen identically as on the Android version...

    — commented 7 months ago by Takahito Torimoto

  • Well, I know Mobile Web's source code maintains aspect ratio. The docs says:

    Specifying either a width or height property for this view will scale its image(s) with the aspect ratio maintained, up to a maximum size that does not exceed its parent view.
    http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.ImageView

    Sounds like you might have stumbled across a bug in Android. Furthermore, I think there should probably be a property to allow NOT preserve the aspect ratio.

    — commented 7 months ago by Chris Barber

Your Answer

Think you can help? Login to answer this question!