{ "id": "107237", "key": "TIMOB-12421", "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": [ { "id": "15564", "description": "2013 Sprint 15 API", "name": "2013 Sprint 15 API", "archived": true, "released": true, "releaseDate": "2013-07-29" }, { "id": "15567", "description": "2013 Sprint 15", "name": "2013 Sprint 15", "archived": true, "released": true, "releaseDate": "2013-07-29" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-07-23T03:48:35.000+0000", "created": "2013-01-01T16:29:13.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "exalture" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-10-09T15:11:32.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": "h6.Problem\r\nUsing the 'horizontal' layout with the horizontalWrap to false.\r\n\r\nh6.Expected behavior\r\nAllow to create auto resizing views. Important part of it is using Ti.UI.FILL layout.\r\n\r\n_An use case_, for example if you have tableviewrow with an image on the left a label in the middle and an optional button on the right, you can easily layout the whole of it.\r\n\r\n_Yet there's one catch_, when a view layouts its children, if a child has a Ti.UI.FILL width, it doesnt take in account the \"next\" siblings. It just takes the remaning width. Consequently and \"next\" child will be out of the view.\r\n\r\nViews with Ti.UI.FILL should be seen as \"spacer\" and take as much width as possible but computed last! This is the behavior of spacers in toolbars.\r\n\r\nh6.Working sample\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\nwin.backgroundColor = 'white';\r\n\r\nvar view = Ti.UI.createView({\r\n\theight : Ti.UI.SIZE,\r\n\twidth : Ti.UI.FILL,\r\n\tlayout : 'horizontal',\r\n\thorizontalWrap : false\r\n});\r\nwin.add(view);\r\n\r\nview.add(Ti.UI.createView({\r\n\tbackgroundColor : 'black',\r\n\tleft : 2,\r\n\twidth : 30,\r\n\theight : 20\r\n}));\r\n\r\nview.add(Ti.UI.createView({\r\n\tbackgroundColor : 'red',\r\n\tleft : 2,\r\n\twidth : Ti.UI.FILL,\r\n\theight : 20\r\n}));\r\n\r\nview.add(Ti.UI.createView({\r\n\tbackgroundColor : 'blue',\r\n\tleft : 2,\r\n\twidth : 20,\r\n\theight : 20\r\n}));\r\n\r\nview.add(Ti.UI.createView({\r\n\tbackgroundColor : 'green',\r\n\tleft : 2,\r\n\twidth : Ti.UI.FILL,\r\n\theight : 40\r\n}));\r\n\r\nview.add(Ti.UI.createView({\r\n\tbackgroundColor : 'black',\r\n\tleft : 2,\r\n\twidth : 30,\r\n\theight : 40\r\n}));\r\n\r\nvar b1 = Titanium.UI.createButton({\r\n\ttitle : 'I am a Button',\r\n\theight : 40,\r\n\twidth : 200,\r\n\ttop : 10\r\n});\r\n\r\nb1.addEventListener('click', function() {\r\n\tview.layout = (view.layout === 'horizontal') ? 'vertical' : 'horizontal';\r\n\tif (view.layout === 'horizontal')\r\n\t\tview.horizontalWrap = !(view.horizontalWrap);\r\n});\r\nwin.add(b1)\r\nwin.open(); \r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Horizontal Wrap: Ti.UI.FILL doesn't seem to be used correctly", "creator": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "environment": "Titanium 3.1.0 master\r\niOS sdk 6.0\r\niOS 6 simulator", "comment": { "comments": [ { "id": "232833", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2013-01-01T16:44:19.000+0000", "updated": "2013-01-02T09:56:06.000+0000" }, { "id": "235823", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Updated labels and moved to main project to dig into it.\n\nCheck out CLA here: http://docs.appcelerator.com/titanium/latest/#!/guide/Pull_Request_Guide", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-01-25T00:03:04.000+0000", "updated": "2013-01-25T00:03:04.000+0000" }, { "id": "262772", "author": { "name": "vduggal", "key": "vduggal", "displayName": "Vishal Duggal", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Can not accept this PR.\r\n\r\n1. The overall desired outcome completely breaks the Composite Layout Spec as defined here - http://docs.appcelerator.com/platform/latest/#!/guide/UI_Composite_Layout_Behavior_Spec-section-4196675_UICompositeLayoutBehaviorSpec-FILLbehavior\r\n2. It does not completely implement the spacer functionality (What if I had a bunch of Views with height specified as 'SPACER' in a vertical layout)\r\n3. Does not define behavior of a 'SPACER' inside a View following SIZE.\r\n\r\nMarking this ticket invalid.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-07-23T03:48:22.000+0000", "updated": "2014-02-21T20:32:35.000+0000" }, { "id": "294330", "author": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "body": "@Vishal: I totally understand. First that PR is far too old and i can't support anymore.\r\n 1. It does not really break it, it defines a case which is not really specified for FILL ('vertical', 'horizontal', 'horizontal' + \"wrap\").\r\n 2. I don't really remember how it was at that point. I rewrote the whole layout pass and that with it. Right now it does work in any layout and follows the specified rules from 1\r\n 3. The idea is that it works exactly like specified in 1. You can see spacer as a view with weight 1 in a linearlayout on Android.\r\n\r\nAnyway thanks for taking the time to answer", "updateAuthor": { "name": "farfromrefuge", "key": "farfromrefuge", "displayName": "Martin Guillon", "active": false, "timeZone": "Europe/Berlin" }, "created": "2014-02-24T12:59:38.000+0000", "updated": "2014-02-24T12:59:38.000+0000" }, { "id": "416861", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-04-05T17:26:53.000+0000", "updated": "2017-04-05T17:26:53.000+0000" }, { "id": "428827", "author": { "name": "a.marcone", "key": "a.marcone", "displayName": "Alberto Marcone", "active": true, "timeZone": "Europe/Berlin" }, "body": "this is still happening and there's no solution on the market yet. Two views inside an horizontal view are not wrapped correctly if one view has a FILL width.", "updateAuthor": { "name": "a.marcone", "key": "a.marcone", "displayName": "Alberto Marcone", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-10-09T15:11:32.000+0000", "updated": "2017-10-09T15:11:32.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }