{ "id": "167976", "key": "TIMOB-24757", "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": null, "resolutiondate": null, "created": "2017-05-29T17:15:10.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:55:15.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [], "description": "var myWindow = Ti.UI.createWindow({ backgroundColor: '#fff' });\r\nmyWindow.open();\r\n\r\nvar myContainer = Ti.UI.createView({\r\n\tleft: '0dp',\r\n\ttop: '80dp',\r\n\tright: '0dp',\r\n\theight: '200dp',\r\n\tbackgroundColor: '#ddd',\r\n\tlayout: 'horizontal'\r\n});\r\nmyWindow.add(myContainer);\r\n\r\nvar div1 = Ti.UI.createLabel({\r\n\tright: '20dp',\r\n\ttop:'10dp',\r\n\twidth: '100dp',\r\n\tbackgroundColor:'#ffeedd',\r\n\ttext:'DIV1'\r\n});\r\nmyContainer.add(div1);\r\n\r\nvar div2 = Ti.UI.createLabel({\r\n\tright: '15dp',\r\n\ttop:'10dp',\r\n\twidth: '100dp',\r\n\tbackgroundColor:'#ddeeff',\r\n\ttext:'DIV2'\r\n});\r\nmyContainer.add(div2);\r\n\r\nvar div3 = Ti.UI.createLabel({\r\n\tright: '10dp',\r\n\ttop:'10dp',\r\n\twidth: '100dp',\r\n\tbackgroundColor:'#ccffcc',\r\n\ttext:'DIV4'\r\n});\r\nmyContainer.add(div3);\r\n\r\n", "attachment": [], "flagged": false, "summary": "right-to-left floating views", "creator": { "name": "dr@camindo.de", "key": "dr@camindo.de", "displayName": "dr@camindo.de", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "dr@camindo.de", "key": "dr@camindo.de", "displayName": "dr@camindo.de", "active": true, "timeZone": "Europe/Berlin" }, "environment": "OSX, Appcelerator Studio *4.8*.1.201612050850\r\nTitanium SDK 6.0.4 GA", "comment": { "comments": [ { "id": "420578", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, This is not a bug. For view layout set to horizontal the children are always laid horizontally from left to right. The left and right properties in child are used as padding between the children, and the top and bottom properties are used to position the children vertically. http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.View-property-layout. So, with horizontal layout child elements are always set from left to right. Remove horizontal layout from the parent view and calculate and set the right values in the child labels\r\n{code}\r\nvar win = Ti.UI.createWindow();\r\n\r\nwin.open();\r\n\r\nvar div1 = Ti.UI.createView({\r\n width : Ti.UI.FILL,\r\n height : '40dp',\r\n top : '80dp',\r\n borderColor : '#ffeedd',\r\n borderRadius : 10,\r\n\r\n});\r\nwin.add(div1);\r\nvar div2 = Ti.UI.createLabel({\r\n right : '20dp',\r\n top : '10dp',\r\n width : '100dp',\r\n backgroundColor : '#ffeedd',\r\n text : 'DIV2'\r\n});\r\ndiv1.add(div2);\r\nvar div3 = Ti.UI.createLabel({\r\n right : '135dp',\r\n top : '10dp',\r\n width : '100dp',\r\n backgroundColor : '#ddeeff',\r\n text : 'DIV3'\r\n});\r\ndiv1.add(div3);\r\nvar div4 = Ti.UI.createLabel({\r\n right : '245dp',\r\n top : '10dp',\r\n width : '100dp',\r\n backgroundColor : '#ccffcc',\r\n text : 'DIV4'\r\n});\r\ndiv1.add(div4);\r\n{code}\r\n ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-05-29T19:26:15.000+0000", "updated": "2017-05-29T19:26:15.000+0000" }, { "id": "420579", "author": { "name": "dr@camindo.de", "key": "dr@camindo.de", "displayName": "dr@camindo.de", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks for your answer.\r\nBut in this case my views are not floating - e.g. if I have 50 div's.\r\nCan you please register this as a feature request. We have 2017 and apps in the arabic world have to work in a different way.\r\n", "updateAuthor": { "name": "dr@camindo.de", "key": "dr@camindo.de", "displayName": "dr@camindo.de", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-29T20:14:54.000+0000", "updated": "2017-05-29T20:14:54.000+0000" }, { "id": "420580", "author": { "name": "dr@camindo.de", "key": "dr@camindo.de", "displayName": "dr@camindo.de", "active": true, "timeZone": "Europe/Berlin" }, "body": "As a workaround I will calculate absolute positions and use eventHandler \"postlayout\" to check if device has been rotated.\r\nBut it's a complex calculation. An attribute \"rtl\" additional to \"layout\" would help in future.\r\nThanks for your investigation!", "updateAuthor": { "name": "dr@camindo.de", "key": "dr@camindo.de", "displayName": "dr@camindo.de", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-05-29T20:30:34.000+0000", "updated": "2017-05-29T20:30:34.000+0000" }, { "id": "420767", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Ok, sure. I will forward this to engineering for future improvement. ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-06-01T13:52:02.000+0000", "updated": "2017-06-01T13:52:39.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }