{ "id": "75916", "key": "TIMOB-4351", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "11358", "description": "Mobile 1.8.0 M05", "name": "Sprint 2011-26", "archived": true, "released": true, "releaseDate": "2011-07-04" }, { "id": "12089", "description": "", "name": "Sprint 2011-49", "archived": true, "released": true, "releaseDate": "2011-12-12" } ], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2011-12-05T12:26:53.000+0000", "created": "2011-06-08T10:04:12.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11244", "name": "Release 1.7.0", "archived": true, "released": true, "releaseDate": "2011-06-13" } ], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-03T22:28:59.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h1. Feature\r\nThe \"canScale\" property exists on Android, but not on iOS. It lets you pinch around an image.\r\n\r\nh2. Workaround\r\nOn iOS, you can dump the image in a scroll view. But it takes quite a bit more code to get it to work properly.\r\n\r\nh2. Sample Code\r\nThe following shows a large remote image (~500kb). It may take a moment for the sample to come up. Feel free to download the image locally to speed it up. It demonstrates the Android and iOS approaches to a scalable image.\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({ backgroundColor: '#000' });\r\n\r\nvar image = Ti.UI.createImageView({\r\n image: 'http://appc.me/content/appceleratorHat.jpg',\r\n width: 'auto', height: 'auto', canScale: true\r\n});\r\nif (Ti.Android) {\r\n // this simple code works in Android\r\n win.add(image);\r\n}\r\nelse {\r\n // but iOS requires all of this\r\n var scroll = Ti.UI.createScrollView({\r\n contentHeight: 'auto', contentWidth: 'auto',\r\n maxZoomScale: 1, minZoomScale: 0.16\r\n });\r\n image.addEventListener('load', function() {\r\n scroll.zoomScale = 0.16;\r\n });\r\n scroll.add(image);\r\n win.add(scroll);\r\n}\r\nwin.open();\r\n{code}\r\n\r\nh3. Associated Helpdesk Ticket\r\nhttp://appc.me/APP-121155 http://appc.me/APP-422217 http://appc.me/APP-768251", "attachment": [], "flagged": false, "summary": "iOS: Add \"canScale\" to ImageView for Parity with Android", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium SDK version: 1.7.0 (06/06/11 15:46 64155ee...)", "comment": { "comments": [ { "id": "157599", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The native iOS doesn't have a 'canScale' property in UIImageView, and implementing this would have a significant performance and memory hit for *any* image view as we'd be manually stuffing it into the scroll view, even *if* canScroll was false.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-06-22T17:11:45.000+0000", "updated": "2011-06-22T17:11:45.000+0000" }, { "id": "172147", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Pull request for this functionality was sent in by Dohko from the community:\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/426/files", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-11-10T08:15:05.000+0000", "updated": "2011-11-10T08:15:05.000+0000" }, { "id": "174862", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Need to re-evaluate.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T10:44:09.000+0000", "updated": "2011-12-05T10:44:09.000+0000" }, { "id": "174883", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Rejecting request now with the text:\r\n\r\nThe canScale property is that, in Android, you can zoom and pan an image within its view. To have something similar, it'd require embedding a UIScrollView into the view hierarchy of each image view, which is incredibly expensive. This code appears to instead disable the proper scaling of the image inside its view, meaning it will ignore the size specified by the view, which is NOT what canScale is meant to do.", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T12:25:32.000+0000", "updated": "2011-12-05T12:25:32.000+0000" }, { "id": "174884", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Implementing such would be rather expensive performance-wise on each image view, and may lead to other regressions (IE, an imageview with canscale would be unpredictable within a table view)", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-12-05T12:26:53.000+0000", "updated": "2011-12-05T12:26:53.000+0000" }, { "id": "408969", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing as duplicate.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-03T22:28:59.000+0000", "updated": "2017-03-03T22:28:59.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }