{ "id": "165054", "key": "TIMOB-24247", "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": "2016-12-16T20:31:26.000+0000", "priority": null, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-02-28T19:54:59.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": "Titanium has a horizontal and vertical layout before iOS stack view, by calculating the position of each child view, it was very good at that time.\r\n\r\nSince iOS has native support now, thanks UIStackView and very soon iOS 9 will be the minimum iOS supported by Xcode, it's the time to refactor that old code in favor of UIStackView and force autolayout in all apps.\r\n\r\nAt least it's the time now to refactor Android code with LinearLayout.\r\n\r\nThis part very important for RTL applications, with UIStackView and LinearLayout, apps flipping automatically with max 5% effort to optimize switching between both RTL and LTR.\r\n\r\nUnfortunately till now we need more effort with Titanium.", "attachment": [], "flagged": false, "summary": "Layout behave different than native", "creator": { "name": "hazemkhaled", "key": "hazemkhaled", "displayName": "Hazem Khaled", "active": true, "timeZone": "Europe/Istanbul" }, "subtasks": [], "reporter": { "name": "hazemkhaled", "key": "hazemkhaled", "displayName": "Hazem Khaled", "active": true, "timeZone": "Europe/Istanbul" }, "environment": null, "comment": { "comments": [ { "id": "403541", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Can you share an example of the issue you described? ", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2016-12-16T20:55:36.000+0000", "updated": "2016-12-16T20:55:36.000+0000" }, { "id": "403555", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey [~hazemkhaled], this more an improvement than issue or am I missing something? But anyway, I think it's a great idea we could follow. I'm currently thinking if we should expose the {{UIStackView}} as an own API, maybe even with parity with the existing {{Ti.UI.Android.CardView}} *or* handle it internally whenever people use a vertical/horizontal layout.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2016-12-17T15:56:11.000+0000", "updated": "2016-12-17T15:56:58.000+0000" }, { "id": "403712", "author": { "name": "hazemkhaled", "key": "hazemkhaled", "displayName": "Hazem Khaled", "active": true, "timeZone": "Europe/Istanbul" }, "body": "@Sharif AbuDarda I'll add example and screenshots to my [RTL guide|https://github.com/HazemKhaled/Titanium_RTL_guide] and update the issue again\r\n\r\n@Hans Knoechel I'll give it a try titanium and native and return you with different behavior", "updateAuthor": { "name": "hazemkhaled", "key": "hazemkhaled", "displayName": "Hazem Khaled", "active": true, "timeZone": "Europe/Istanbul" }, "created": "2016-12-21T05:39:12.000+0000", "updated": "2016-12-21T05:39:12.000+0000" }, { "id": "426709", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The big problem with this is that there are \"portability\" issues between Android and iOS on how they natively handle layouts. That is, if we were to do this, views would end up being layed-out different between Android and iOS.\r\n\r\nFor example, how Android and iOS handle Ti.UI.SIZE and Ti.UI.FILL conflicts between a parent and child respectively is handled very differently. That is, when the parent is set up to auto-size itself based on the child and the child wants to auto-size itself based on the parent (this is unfortunately a very common scenario in Titanium apps). In this scenario on iOS, the child will be increased in size to fill the parent's parent. On Android, the parent will be shrunk down to just-fit the min size of the child. This is their opposing native behaviors.\r\n\r\nAnother issue is with zIndex handling. iOS does support views with a higher zIndex in the middle of a vertical or horizontal layout. On Android, LinearLayout do not support this.\r\n\r\nAlso, I'm pretty sure an Android LinearLayout doesn't support overlapping views, which is something our Titanium top/left/bottom/right properties support.\r\n\r\nOn Android, I recommend that we keep our custom layout code. We need it to make Android Titanium app layouts behave like iOS for portability reasons. Features such as right-to-left handling in horizontal layouts will have to be implemented ourselves.", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-08-15T21:05:51.000+0000", "updated": "2017-08-15T21:05:51.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }