{ "id": "105560", "key": "AC-2169", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-04-06T18:35:41.000+0000", "created": "2012-11-27T13:11:03.000+0000", "labels": [ "opacity", "view" ], "versions": [], "issuelinks": [], "assignee": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:09.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "*Problem description*\r\nWhen having a parent-child views and the parent opacity is set, the child is inheriting the opacity value from its parent. I tried to explicitly set the opacity of the child to 1.0 but it didn't work, the property inheritance keeps taking place.\r\n\r\n*Test case*\r\n{code}\r\nvar window = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\n\r\nvar homeView = Ti.UI.createScrollView({\r\n\twidth : Ti.UI.FILL,\r\n\theight : Ti.UI.FILL,\r\n\tbackgroundColor : 'red',\r\n\tscrollType : 'vertical'\r\n});\r\n\r\nvar parent = Ti.UI.createView({\r\n\tbackgroundColor : 'black',\r\n\topacity : 0.8,\r\n\ttop : 0,\r\n\tleft : 0,\r\n\tzIndex : 5,\r\n\tvisible : true,\r\n\theight : 200,\r\n\ttouchEnabled : true\r\n});\r\n\r\nvar child = Ti.UI.createView({\r\n\tbackgroundColor : '#eeeeee',\r\n\twidth : 100,\r\n\theight : 100\r\n});\r\n\r\nparent.add(child);\r\nhomeView.add(parent);\r\n\r\nwindow.add(homeView);\r\nwindow.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Opacity property inheritance in parent-child views", "creator": { "name": "sameeh.harfoush", "key": "sameeh.harfoush", "displayName": "Sameeh Harfoush ", "active": true, "timeZone": "Asia/Beirut" }, "subtasks": [], "reporter": { "name": "sameeh.harfoush", "key": "sameeh.harfoush", "displayName": "Sameeh Harfoush ", "active": true, "timeZone": "Asia/Beirut" }, "environment": "Application type: mobile \r\nTitanium SDK: 2.1.3GA \r\nPlatform & version: Android ICS \r\nDevice: Sony Xperia", "comment": { "comments": [ { "id": "228717", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Would it be possible to provide a simple test case for this? Thanks!", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-27T22:21:43.000+0000", "updated": "2012-11-27T22:21:43.000+0000" }, { "id": "228808", "author": { "name": "sameeh.harfoush", "key": "sameeh.harfoush", "displayName": "Sameeh Harfoush ", "active": true, "timeZone": "Asia/Beirut" }, "body": "this.homeView = Ti.UI.createScrollView({\n\t\t\twidth : Ti.UI.FILL,\n\t\t\theight : Ti.UI.FILL,\n\t\t\tbackgroundColor : 'red',\n\t\t\tscrollType : 'vertical'\n\t\t});\n\nvar parent = Ti.UI.createView({\n\t\t\tbackgroundColor : 'black',\n\t\t\topacity : 0.8,\n\t\t\ttop : 0,\n\t\t\tleft : 0,\n\t\t\tzIndex : 5,\n\t\t\tvisible : true,\n\t\t\theight : 200,\n\t\t\ttouchEnabled : true\n\t\t});\n\t\tvar child = Ti.UI.createView({\n\t\t\tbackgroundColor : '#eeeeee',\n\t\t\twidth : 100,\n\t\t\theight : 100\n\n\t\t});\n\t\tparent.add(child);\n\t\tthis.homeView.add(parent);\n\n\nadd this.homeView to a window or any other view you will see that \"child\" view background with get a redish color.\n\nthank you.", "updateAuthor": { "name": "sameeh.harfoush", "key": "sameeh.harfoush", "displayName": "Sameeh Harfoush ", "active": true, "timeZone": "Asia/Beirut" }, "created": "2012-11-28T09:57:47.000+0000", "updated": "2012-11-28T09:57:47.000+0000" }, { "id": "246166", "author": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It makes sense that this occurs. Group layers in any image application (photoshop, fireworks), set the opacity on the parent, all children will and should inherit the value. If you don't want it to inherit the opacity, don't make it a child.", "updateAuthor": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-06T18:35:18.000+0000", "updated": "2013-04-06T18:35:18.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }