Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1434] Android: Image Doesn't Size with Layout

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:56:10.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.5.0 M01
ComponentsAndroid
Labelsandroid, defect, imageview
ReporterDon Thorp
AssigneeMarshall Culpepper
Created2011-04-15T02:52:17.000+0000
Updated2011-04-17T01:56:10.000+0000

Description

See http://developer.appcelerator.com/helpdesk/view/32741">Helpdesk 32741

If a specific height/width is set on an image, it should scale to that size.

Sample failcase is the KitchenSink Views - Image Views - Remote Image test, whereby the second graphic when you load the test should be a cloud. instead it looks like this: https://skitch.com/billdawson/ryfin/dock">https://skitch.com/billdawson/ryfin/dock. Also the Image Scaling test, in which you can see that the image is not really scaled up as it should be.

Comments

  1. Brion Vibber 2011-04-15

    This appears to require manually setting the canScale property on, and then the enableZoomControls property off to keep normal behavior.

    It would likely be most consistent to set these properties this way by default, providing consistent behavior between platforms.

  2. Don Thorp 2011-04-15

    I'm reworking image cache and image view. The canScale feature was a hold over from 0.8.

  3. hal 2011-04-15

    I just want to note here, for my future reference as much as anything, that backgroundImage and all its permutations (ie. background*Image) scale up and down without issue.

  4. hal 2011-04-15

    Brion's workaround does not work for me. This is my code:

       var thisImage = Ti.UI.createImageView({
           width: 200,
           height: 200,
           canScale:true,
           enableZoomControls:false,
           image: '/image.png'
       });
       
       win.add(thisImage);
       

    The image is displayed at its original dimensions, which is 100x100.
    As I have stated above, background*Image does work as expected.

  5. hal 2011-04-15

    Forgot to mention, I am using 1.4.X from 25th October.

  6. hal 2011-04-15

    OK, last update :)
    Brion's workaround works for scaling images down, but not up.

  7. Bill Dawson 2011-04-15

    (from [69b0d181d7b89d9214c55edf7139ec5265b175c2]) [#1434] [#1252 state:fixed-in-qa] Introduce new TiDrawableReference class which can be used to track the source of drawables as well as fetch their bytes. TiUIImageView changed as first example of how we might use TiDrawableReference. Fixed ImageView animation pause/restart bug while digging around in TiUIImageView. https://github.com/appcelerator/titanium_mobile/commit/69b0d181d7b89d9214c55edf7139ec5265b175c2"> https://github.com/appcelerator/titanium_mobile/commit/69b0d181d7b8...

  8. Bill Dawson 2011-04-15

    (from [c8fb4db1c72a116aafbc9fbd01f24ea3b87741af]) [#1434] Fix how TiDrawableReference determines if path represents a resource https://github.com/appcelerator/titanium_mobile/commit/c8fb4db1c72a116aafbc9fbd01f24ea3b87741af"> https://github.com/appcelerator/titanium_mobile/commit/c8fb4db1c72a...

  9. Bill Dawson 2011-04-15

    (from [0a21c0a5fcd28a5cf9f2a0e49c7ec64d0ef03df1]) [#1434] Make KS test case for density-specific images since it didn't exist yet and is relevant with respect to new TiDRawableReference https://github.com/appcelerator/titanium_mobile/commit/0a21c0a5fcd28a5cf9f2a0e49c7ec64d0ef03df1"> https://github.com/appcelerator/titanium_mobile/commit/0a21c0a5fcd2...

  10. Bill Dawson 2011-04-15

    (from [080d9273c1e155687cfc4cb56405ff9c28363312]) [#1434 state:fixed-in-qa] TiDrawableReference now supports scaling and sampling, and TiUIImageView now uses it. Remove references to "RA" from TiUIHelper since we no longer generate an RA.java. https://github.com/appcelerator/titanium_mobile/commit/080d9273c1e155687cfc4cb56405ff9c28363312"> https://github.com/appcelerator/titanium_mobile/commit/080d9273c1e1...

  11. Bill Dawson 2011-04-15

    (from [e21d79a58c7c25df8769fd3477ca87587aa67a14]) The android.ui.imageview drillbit test is no longer valid after [#1434] because OutOfMemoryError exceptions (from image loading) don't crash the app anymore https://github.com/appcelerator/titanium_mobile/commit/e21d79a58c7c25df8769fd3477ca87587aa67a14"> https://github.com/appcelerator/titanium_mobile/commit/e21d79a58c7c...

  12. Matt Schmulen 2011-04-15

    pass regression android 2.1 sim.

  13. Matt Schmulen 2011-04-15

    passed regression android 1.6 sim Titanium SDK version: 1.5.0 (11/22/10 20:42 19a59fd)

JSON Source