{ "id": "100550", "key": "TIMOB-10795", "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": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2012-09-11T15:14:50.000+0000", "created": "2012-09-06T10:13:41.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "core", "module_views", "qe-testadded" ], "versions": [ { "id": "14096", "description": "Release 2.1.2", "name": "Release 2.1.2", "archived": true, "released": true, "releaseDate": "2012-08-31" } ], "issuelinks": [ { "id": "20755", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "100614", "key": "TIMOB-10812", "fields": { "summary": "Android: Ti.UI.SIZE on width does not work with horizontal layouts", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-04T07:04:49.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": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h3. Issue\r\n\r\nWhen a view has its width set to Ti.UI.SIZE, along with a layout of horizontal, the width does not wrap to the size of its child containers, instead filling out the parent that it is placed into (on Android). On iOS, the width wraps around fine.\r\n\r\nh3. Sample Code\r\n\r\n{noformat}\r\n\r\nTitanium.UI.setBackgroundColor('#000');\r\n\r\nvar win1 = Titanium.UI.createWindow({\r\n backgroundColor : 'gray'\r\n});\r\nwin1.open();\r\n\r\nvar createLogoView = function() {\r\n return Ti.UI.createImageView({\r\n image : 'KS_nav_ui.png',\r\n height : '26dp',\r\n left : 0,\r\n borderColor : 'green',\r\n borderWidth : 1\r\n });\r\n}\r\nvar createInfoIcon = function() {\r\n return Ti.UI.createImageView({\r\n image : 'KS_nav_ui.png',\r\n height : '15dp',\r\n left : 0,\r\n borderColor : 'blue',\r\n borderWidth : 1\r\n });\r\n}\r\n\r\n\r\nvar createHeaderContainer = function(leftView, rightView) {\r\n\r\n //We won't know the width of the leftView, so we want this container to be SIZE,\r\n //as we want the left and right views to be pressed up against each other horizontally,\r\n //but the overall container to be centered in the navBar.\r\n var headerContainer = Ti.UI.createView({\r\n height : Ti.UI.SIZE,\r\n width : Ti.UI.SIZE,\r\n layout : 'horizontal',\r\n borderColor : 'red',\r\n borderWidth : 1\r\n });\r\n\r\n headerContainer.add(leftView);\r\n headerContainer.add(rightView);\r\n\r\n return headerContainer;\r\n\r\n}\r\n\r\n//NavBar color strip\r\nvar createNavBar = function() {\r\n\r\n var navBar = Ti.UI.createView({\r\n height : '44dp',\r\n width : Titanium.Platform.displayCaps.platformWidth,\r\n top : 0,\r\n backgroundGradient : {\r\n type : 'linear',\r\n startPoint : {\r\n x : '0%',\r\n y : '0%'\r\n },\r\n endPoint : {\r\n x : '0%',\r\n y : '100%'\r\n },\r\n colors : [{\r\n color : \"#4199f2\",\r\n offset : 0.0\r\n }, {\r\n color : \"#3074b8\",\r\n offset : 1.0\r\n }]\r\n }\r\n });\r\n\r\n // Container holding the logo and info icon -- Should be centered, but ends up on left side of screen on Android\r\n var logoContainer = createHeaderContainer(createLogoView(), createInfoIcon());\r\n navBar.add(logoContainer);\r\n\r\n return navBar;\r\n}\r\n\r\nwin1.add(createNavBar());\r\n{noformat}\r\n\r\nThis issue did not exist in Release 2.1.0.GA. Attached is the screenshot of how it looks like in Android.", "attachment": [ { "id": "31038", "filename": "Screen Shot 2012-09-06 at 10.09.27 AM.png", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2012-09-06T10:13:41.000+0000", "size": 18870, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Ti.UI.SIZE on a view does not work with layout property set", "creator": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "environment": "Titanium SDK: 2.1.2.GA\r\nPlatform OS: Android 4.1, 4.0", "comment": { "comments": [ { "id": "224903", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with:\r\nSDK:3.0.0.v20121024144610\r\nStudio: 3.0.0.201210220122\r\nDevice:HTC Desire V(Android 4.0.3)\r\n\r\nTi.UI>SIZE works properly with layout property set.", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-25T09:38:09.000+0000", "updated": "2012-10-25T09:38:09.000+0000" } ], "maxResults": 1, "total": 1, "startAt": 0 } } }