{ "id": "84647", "key": "TIMOB-7057", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "2012-01-10T08:17:36.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "parity" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [ { "id": "14995", "type": { "id": "10011", "name": "Includes", "inward": "is included by", "outward": "includes" }, "outwardIssue": { "id": "85147", "key": "TIDOC-286", "fields": { "summary": "APIDoc: docgen.py should produce warnings for bad links", "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": "Medium", "id": "3" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-08-02T17:31:42.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": [ { "id": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "h2. Problem\r\n\r\nCurrently, Android silently ignores a label added to an imageView, whereas iOS accepts and shows the label. Test this using the code below.\r\n\r\nFrom what I understand, only Ti.UI.View and Ti.UI.Window should accept child views. Hence, this ticket requests parity between the two platforms.\r\n\r\nMy feeling is that an exception should be thrown on both platforms, to make the intended behavior clear to the user.\r\n\r\nh2. Test case\r\n\r\n{code:lang=javascript|title=app.js}\r\nTi.UI.setBackgroundColor('#000');\r\n\r\nvar win = Ti.UI.createWindow({\r\n backgroundColor:'#fff'\r\n});\r\n\r\nvar imageview = Ti.UI.createImageView({\r\n image:'KS_nav_views.png'\r\n});\r\nvar label = Ti.UI.createLabel({\r\n color:'#000',\r\n text:'I am a label',\r\n font:{fontSize:20,fontFamily:'Helvetica Neue'},\r\n textAlign:'center',\r\n width:'auto'\r\n});\r\nimageview.add(label);\r\nwin.add(imageview);\r\n\r\nwin.open();\r\n{code}\r\n\r\nh2. References\r\n\r\nSee ticket TC-550, where this situation caused confusion.", "attachment": [], "flagged": false, "summary": "Ti.API: UI - prohibit child views being added to views other than UI.Window and UI.View", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": null, "comment": { "comments": [ { "id": "178660", "author": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "body": "Being the one who reported TC-550 20min earlier than this reporter, I have to tell you that I think removing this from other views is totally counter-productive. Feel free to take a look at TC-551 to see how this is actually a useful thing.\r\n\r\nAlso, in the past, we've been displaying some things using a WebView. The fact that WebView on iOS permits child views, was REALLY helpful when porting the code away from WebView towards native controls. Only this feature has provided us with a way to extract one piece of information at a time and also provided us with a way to display both the old content and the new one (which is far more usable than using e.g. screenshots when making sure that the native layout is a pixel-perfect clone of the WebView-based one).", "updateAuthor": { "name": "herzberg", "key": "herzberg", "displayName": "Sven Herzberg", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-01-10T08:31:39.000+0000", "updated": "2012-01-10T08:31:39.000+0000" }, { "id": "178824", "author": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Paul,\r\n\r\n\r\nthere are more View-like components that can contain other components - TableViewRow and ScrollView.\r\n\r\n...\r\n\r\nIMO, \"ImageView\" is not the best name because of \"View\" part. When users read this part from documentation: \"Views are always named with the suffix View\" and this: \"Views are containers that host visual elements such as controls or other views\", they are easily confused. \"ImageView\" is not container and that should be pointed somewhere and it's \"add\" and \"remove\" methods should be removed from documentation.\r\n\r\nAlso, \"TableView\" component has similar issue. There are \"add\" and \"remove\" methods that do nothing unfortunately (I'm not sure about \"remove\", didn't test it, but \"add\" method does not work even with \"TableViewRow\"). It would be great if they were used in combination with \"TableViewSection\" and \"TableViewRow\" components so we can add sections and rows through \"add\" method and remove them through \"remove\" method (and be warned if something else if being passed to that methods). That would make overall Titanium API design more clearer and intuitive.\r\n\r\nAlso, it must be stated that \"TableViewSection\" and \"TableViewRow\" cannot exist for themselves (maybe small API documentation design change could be benifical, so that from design that's clear):\r\n\r\n{code}\r\nOtherComponent1\r\nTableView\r\n TableViewSection\r\n TableViewRow\r\nOtherComponent2\r\n{code}\r\n\r\n(Picker has similar problem) \r\n\r\n\r\nSorry for mention of unrelated things, but I think it good to know where things can be better. :)\r\n\r\n\r\n\r\nCheers.", "updateAuthor": { "name": "ivan.skugor", "key": "ivan.skugor", "displayName": "Ivan Skugor", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2012-01-11T01:07:13.000+0000", "updated": "2012-01-11T01:09:26.000+0000" }, { "id": "178893", "author": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "body": "I think ImageView in this case is an anomaly, as Ivan suggests, because of the name.\r\n\r\nThere's already a separate bug open to document the current restrictions for ImageView (TIMOB-6241).\r\n\r\nWe need to document which UI objects support the 'add' method. (Or more accurately, we need to mark any objects that inherit from View but do *not* support add, because that's the way TDoc works.)\r\n\r\nPaul, can you either open a doc bug for this or repurpose this bug?", "updateAuthor": { "name": "aevans", "key": "aevans", "displayName": "Arthur Evans", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-11T11:02:22.000+0000", "updated": "2012-01-11T11:02:22.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }