{ "id": "62361", "key": "TIMOB-1729", "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": "12077", "description": "", "name": "Sprint 2011-37", "archived": true, "released": true, "releaseDate": "2011-09-19" }, { "id": "11331", "description": "", "name": "Release 1.8.0", "archived": true, "released": true, "releaseDate": "2011-10-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-11-05T13:38:12.000+0000", "created": "2011-04-15T03:00:42.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [ { "id": "12752", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "80324", "key": "TIMOB-5287", "fields": { "summary": "iOS: Setting zIndex fails on Views", "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": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-11-05T13:38:12.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": "{html}

When zIndex is passed as a creation argument it works. Runtime\r\ndoes not. It looks like there might be a setZIndex method that's in\r\nthe way.

{html}", "attachment": [], "flagged": false, "summary": "Android: Setting zIndex fails on Views", "creator": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "126477", "author": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

In the latest build, changing the zindex at runtime actually\ncauses an exception.

{html}", "updateAuthor": { "name": "hal", "key": "hal", "displayName": "hal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:00:43.000+0000", "updated": "2011-04-15T03:00:43.000+0000" }, { "id": "160486", "author": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "body": "h3.Associated HD ticket\r\nhttp://appc.me/c/APP-764736\r\n\r\nh3.Environment\r\n{noformat}\r\nProduct: Mobile\r\nTitanium SDK: Mobile 1.7.1\r\nPlatform OS: Android\r\nPlatform OS Version: 2.2\r\n{noformat}\r\n\r\nh3.Console Log output\r\n{panel}\r\n07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): (main) [241,422] Sending event: exception on thread: main msg:java.lang.NumberFormatException: unable to parse '1.0' as integer; Titanium 1.7.1,2011/06/13 15:34,4a68cc... 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): java.lang.NumberFormatException: unable to parse '1.0' as integer 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at java.lang.Integer.parse(Integer.java:433) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at java.lang.Integer.parseInt(Integer.java:422) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at java.lang.Integer.parseInt(Integer.java:382) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:253) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at org.appcelerator.titanium.view.TiUIView.propertyChanged(TiUIView.java:325) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:487) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:272) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at android.os.Handler.dispatchMessage(Handler.java:95) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at android.os.Looper.loop(Looper.java:123) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at android.app.ActivityThread.main(ActivityThread.java:4627) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at java.lang.reflect.Method.invokeNative(Native Method) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at java.lang.reflect.Method.invoke(Method.java:521) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 07-23 08:18:01.658: ERROR/TiUncaughtHandler(1143): at dalvik.system.NativeStart.main(Native Method) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): FATAL EXCEPTION: main 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): java.lang.NumberFormatException: unable to parse '1.0' as integer 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at java.lang.Integer.parse(Integer.java:433) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at java.lang.Integer.parseInt(Integer.java:422) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at java.lang.Integer.parseInt(Integer.java:382) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at org.appcelerator.titanium.util.TiConvert.toInt(TiConvert.java:253) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at org.appcelerator.titanium.view.TiUIView.propertyChanged(TiUIView.java:325) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at org.appcelerator.kroll.KrollPropertyChange.fireEvent(KrollPropertyChange.java:21) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:487) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:272) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at android.os.Handler.dispatchMessage(Handler.java:95) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at android.os.Looper.loop(Looper.java:123) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at android.app.ActivityThread.main(ActivityThread.java:4627) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at java.lang.reflect.Method.invokeNative(Native Method) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at java.lang.reflect.Method.invoke(Method.java:521) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 07-23 08:18:01.918: ERROR/AndroidRuntime(1143): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)\r\n{panel}\r\n\r\nh3.Workaround\r\nSet an index value to establish the position relative to other sibling views within an event listener. \r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'white'\r\n});\r\n\r\nvar scrollView = Ti.UI.createScrollView({height:200,top:0});\r\nwin.add(scrollView);\r\n\r\nvar myLastIndex = 9;\r\n\r\nvar view1 = Ti.UI.createView({\r\n\tbackgroundColor:'pink',\r\n\tzIndex: myLastIndex++,\r\n\twidth:200,\r\n\theight:30,\r\n\ttop:10,\r\n\tleft:10\r\n});\r\n\r\nvar view2 = Ti.UI.createView({\r\n\tbackgroundColor:'blue',\r\n\tzIndex:myLastIndex++,\r\n\twidth:200,\r\n\theight:30,\r\n\ttop:15,\r\n\tleft:15\r\n});\r\n\r\nvar view3 = Ti.UI.createView({\r\n\tbackgroundColor:'red',\r\n\tzIndex:myLastIndex++,\r\n\twidth:200,\r\n\theight:30,\r\n\ttop:20,\r\n\tleft:20\r\n});\r\n\r\nscrollView.add(view3);\r\nscrollView.add(view2);\r\nscrollView.add(view1);\r\n\r\nvar l = Ti.UI.createLabel({\r\n\ttext:'scroll view: red on top, blue in the middle, pink below, Click the RED one to sit on top the YELLOW one',\r\n\tcolor:'#777',\r\n\twidth:300,\r\n\theight:30,\r\n\ttop:50,\r\n\tleft:10,\r\n\tfont:{fontSize:12}\r\n});\r\nscrollView.add(l);\r\n\r\nview3.addEventListener('click',function()\r\n{\t\r\n\tvar newView = Ti.UI.createView({\r\n\t\tbackgroundColor:parseInt ('#ff'+myLastIndex),\r\n\t\tzIndex: myLastIndex++,\t\r\n\t\t\twidth:200,\r\n\t\t\theight:30,\r\n\t\t\ttop: 25,\r\n\t\t\tleft:25\r\n\t});\r\n\t\r\n\twin.add(newView);\r\n\tTi.API.info('setting zIndex'+myLastIndex);\r\n});\r\n\r\nwin.open();\r\n{code}\r\n", "updateAuthor": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-07-25T10:55:52.000+0000", "updated": "2011-07-25T10:55:52.000+0000" }, { "id": "165759", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test code for dynamic zIndex changes\r\n\r\n{code:title=\"app.js\"}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor:'white'\r\n});\r\n\r\nvar myLastIndex = 3;\r\n\r\nvar view1 = Ti.UI.createView({\r\n\tbackgroundColor:'yellow',\r\n\tzIndex: 1,\r\n\twidth:200,\r\n\theight:50,\r\n\ttop:10,\r\n\tleft:10\r\n});\r\n\r\nvar view2 = Ti.UI.createView({\r\n\tbackgroundColor:'blue',\r\n\tzIndex:2,\r\n\twidth:200,\r\n\theight:50,\r\n\ttop:35,\r\n\tleft:15\r\n});\r\n\r\nvar view3 = Ti.UI.createView({\r\n\tbackgroundColor:'red',\r\n\tzIndex:myLastIndex++,\r\n\twidth:200,\r\n\theight:50,\r\n\ttop:60,\r\n\tleft:20\r\n});\r\n\r\nwin.add(view3);\r\nwin.add(view2);\r\nwin.add(view1);\r\n\r\nvar l = Ti.UI.createLabel({\r\n\ttext:'scroll view: red on top, blue in the middle, yellow below, Click the RED one to bring YELLOW forward. Click the YELLOW one to send it back.',\r\n\tcolor:'#777',\r\n\twidth:300,\r\n\theight:60,\r\n\ttop:150,\r\n\tleft:10,\r\n\tfont:{fontSize:12}\r\n});\r\nwin.add(l);\r\n\r\nview1.addEventListener('click', function() {\r\n\tif (view1.zIndex != 1) {\r\n\t\tview1.setZIndex(1);\r\n\t}\r\n});\r\n\r\nview3.addEventListener('click',function() {\t\r\n\tview1.zIndex = myLastIndex++;\r\n});\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-09-12T21:56:09.000+0000", "updated": "2011-09-13T07:32:22.000+0000" }, { "id": "166073", "author": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with 1.8.0.v20110914092150 on \nNexus S 2.3.4\nHero 2.1\nGslate 3.1", "updateAuthor": { "name": "nhuynh", "key": "nhuynh", "displayName": "Natalie Huynh", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-14T14:36:47.000+0000", "updated": "2011-09-14T14:36:47.000+0000" }, { "id": "171601", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Fixing labels.", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-11-05T13:38:01.000+0000", "updated": "2011-11-05T13:38:01.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }