{ "id": "88263", "key": "TIMOB-8147", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2012-03-21T09:55:21.000+0000", "created": "2012-03-20T12:36:45.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [], "versions": [ { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" } ], "issuelinks": [], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-24T18:15:15.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": "h4. Problem\r\nIn the 2.0.0.v20120319003254 continuous-build SDK, a View with a height of \"auto\" is displayed much taller than it should be. In SDK 1.8.2, the height was correct (only as tall as it needs to be to surround those things it contains). Therefore, this is a regression.\r\n\r\nh4. Actual result\r\nWith the 2.0.0.v20120319003254 continuous-build SDK, the view (yellow in the testcase below) appears almost the full height of the screen.\r\n\r\nh4. Expected result\r\nThe view (yellow in the testcase below) should be only tall enough to surround the \"X\" that is placed into it. This is how it appeared with the 1.8.2 and earlier SDKs.\r\n\r\nh4. Testcase\r\n{code:title=app.js}\r\nvar win1 = Ti.UI.createWindow({ \r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar label1 = Ti.UI.createLabel({\r\n backgroundColor:'green',\r\n\tcolor:'white',\r\n\ttext:'Spinner should be on top of the X',\r\n\tfont:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n\ttextAlign:'center',\r\n\ttop:40,\r\n\theight:40,\r\n\twidth:'auto'\r\n});\r\nwin1.add(label1);\r\n\r\nvar view1 = Ti.UI.createView({\r\n backgroundColor:'yellow',\r\n height:'auto', \r\n top:100,\r\n width:100\r\n});\r\nwin1.add(view1);\r\n\r\nvar spin1=Ti.UI.createActivityIndicator({\r\n //right:25,\r\n left:25,\r\n style:Ti.UI.iPhone.ActivityIndicatorStyle.DARK\r\n });\r\nview1.add(spin1);\r\nvar marker1=Ti.UI.createLabel({\r\n height:'auto',\r\n width:'auto',\r\n text:'X',\r\n //right:25,\r\n left:25,\r\n });\r\nview1.add(marker1);\r\n\r\nwin1.open();\r\nspin1.show();\r\n{code}\r\n\r\nh4. Extra info\r\nThis test is working fine in 1.8.2", "attachment": [], "flagged": false, "summary": "iOS: Regression: View with 'auto' height is much taller than it should be", "creator": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "environment": "- iOS SDK 5.0\r\n- iPhone simulator\r\n- Mac OSX 10.7.2\r\n- Titanium SDK 2.0.0.v20120319003254\r\n- Titanium Studio 1.0.9.201202141208\r\n\r\n", "comment": { "comments": [ { "id": "187714", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The new Composite Layout behavior in 2.0.0 dictates that View \"auto\" behavior follows FILL (i.e. fill parent container) by default. This will break some apps, but can easily be changed by using the new SIZE constant in place of \"auto\", i.e:\r\n\r\n{code}\r\nTi.UI.createView({\r\n width: Ti.UI.SIZE,\r\n height: Ti.UI.SIZE\r\n});\r\n{code}", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-21T09:54:43.000+0000", "updated": "2012-03-21T09:54:43.000+0000" }, { "id": "187757", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "I think this will break *all* apps that use \"auto\" for heights and widths.\r\n\r\nIs there a guide or documentation for the changes made by the new Composite Layout behavior?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-21T12:10:09.000+0000", "updated": "2012-03-21T12:10:09.000+0000" }, { "id": "187919", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Having \"auto\" mean FILL seems like a poor choice, and I'm sure Appcelerator is going to hear about it from a lot of developers.\r\n\r\nWhile the FILL feature is good, it should not be the default meaning of height:'auto'. IMO, it should have been implemented as height:'fill' as a new feature.\r\n", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-22T05:02:01.000+0000", "updated": "2012-03-22T05:02:01.000+0000" }, { "id": "188014", "author": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We do plan to publish our documentation for this behavior, but I can explain it our \"auto\" behavior a little further here:\r\n\r\nWith our new composite layout work, we have classified \"auto\" layout behavior into two categories:\r\n* FILL (fills the parent container)\r\n* SIZE (constrains to child view content)\r\n\r\nIn Titanium, \"auto\" could either mean FILL or SIZE, depending on the View type, and the platform. Some examples\r\n* A Ti.UI.View in Android would by default have FILL behavior for \"auto\", while iOS would have default SIZE behavior\r\n* WebViews have FILL behavior on both platforms\r\n* ImageViews have SIZE behavior on both platforms\r\n\r\nEven when the cross-platform behavior was consistent, we needed to clearly classify what \"auto\" meant for every view type in our system. Because of these inconsistencies, we are actually deprecating \"auto\" altogether in favor of explicit FILL or SIZE. \"auto\" won't be going away in 2.0, but explicitly using one of these two constants will be the preferred method moving forward, because it reduces confusion on what the behavior of \"auto\" actually means.", "updateAuthor": { "name": "mculpepper", "key": "mculpepper", "displayName": "Marshall Culpepper", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-22T11:03:15.000+0000", "updated": "2012-03-22T11:03:15.000+0000" }, { "id": "188030", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "Marshall, thanks for explaining.\r\n\r\nI personally think that Ti.UI.View's 'auto' behavior being different between Android and iOS is a mistake, since everyone is forced to change as soon as they get 2.0, but as long as it's documented that you should basically change all of your 'auto's to explicit FILL or SIZE, that should suffice.\r\n\r\nThanks again.", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-03-22T12:18:00.000+0000", "updated": "2012-03-22T12:18:00.000+0000" }, { "id": "415649", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T18:15:15.000+0000", "updated": "2017-03-24T18:15:15.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }