{ "id": "86387", "key": "TIMOB-7746", "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-02-13T01:52:49.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": null, "updated": "2018-03-06T18:57:58.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": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "Hello :),\r\n\r\nWish it would be great to add a subview at a specific position like in the ios doc :\r\n\r\ninsertSubview:atIndex:\r\nhttps://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIView_Class/UIView/UIView.html#//apple_ref/occ/cl/UIView\r\n\r\n\r\nhttp://developer.appcelerator.com/question/132056/adding-a-view-to-the-beginning-of-a-scrollable-view#comment-113902\r\n\r\nRegards", "attachment": [], "flagged": false, "summary": "iOS: add a subview at specific index", "creator": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "subtasks": [], "reporter": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "environment": "Titanium mobile sdk 1.8.1.0", "comment": { "comments": [ { "id": "183183", "author": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "updateAuthor": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "created": "2012-02-15T06:23:21.000+0000", "updated": "2012-02-15T06:23:21.000+0000" }, { "id": "185017", "author": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "body": "Hi,\r\n\r\nI'm trying hardly to understand the implementation of the sdk to make a custom function. \r\nThis function would insert a subview in a scrollableView so as to create dynamic content, resolving the case where we need to create subviews o the left.\r\nThe function would insert a subview in the scrollableView at the desired index.\r\nPlus if the index specified is smaller than the index of the current page, then the index of the current page has to be incremented by 1. Doing so, it may don't change the page currently displayed by the container (avoiding the current page to winkle too).\r\n\r\nI don't know anything about objective-C but i can't implement my project with the standard functions provided by the API,\r\nso i ask you humbly if you could help me to do this functionality. \r\n\r\nI saw that each classes uses a proxy for optimisation purposes, and I guess i'll need to update the file TiUIScrollableViewProxy.m with a function \"addViewAtIndex\" that \r\nwould seems like the following :\r\n\r\n\r\n{code}\r\n-(void)addView:(id)args\r\n{\r\n // test\r\n // NSLog(\"test\" + args);\r\n \r\n \r\n\tENSURE_SINGLE_ARG(args,TiViewProxy);\r\n\r\n\t[self lockViewsForWriting];\r\n\t[self rememberProxy:args];\r\n\t[args setParent:self];\r\n\tif (viewProxies != nil)\r\n\t{\r\n\t\t[viewProxies addObject:args]; \r\n\t}\r\n\telse\r\n\t{\r\n\t\tviewProxies = [[NSMutableArray alloc] initWithObjects:args,nil];\r\n\t}\r\n\t[self unlockViews];\t\r\n\t[self makeViewPerformSelector:@selector(addView:) withObject:args createIfNeeded:YES waitUntilDone:NO];\r\n}\r\n{code}\r\n... TiUIScrollableViewProxy.m (line 85-90)\r\n\r\nMany thanks\r\n", "updateAuthor": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "created": "2012-03-05T09:02:10.000+0000", "updated": "2012-03-05T09:02:56.000+0000" }, { "id": "185051", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This is a duplicate of an existing bug, which I can't find at the moment.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-05T11:53:21.000+0000", "updated": "2012-03-05T11:53:21.000+0000" }, { "id": "185724", "author": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "body": "If you don't find the duplicate ticket, please do not close it :)", "updateAuthor": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "created": "2012-03-09T07:50:41.000+0000", "updated": "2012-03-09T07:50:41.000+0000" }, { "id": "187362", "author": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "body": ".", "updateAuthor": { "name": "max", "key": "max", "displayName": "process", "active": true, "timeZone": "Europe/Paris" }, "created": "2012-03-20T07:50:27.000+0000", "updated": "2012-03-20T08:09:32.000+0000" }, { "id": "223196", "author": { "name": "kabriel", "key": "kabriel", "displayName": "Kabriel Robichaux", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "kabriel", "key": "kabriel", "displayName": "Kabriel Robichaux", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-10-11T22:13:04.000+0000", "updated": "2012-10-11T22:13:04.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }