I’m running into some difficulty with how to implement a feature on my app. Specifically, I am trying to add a feature that allows the user to add or subtract identical elements from a scrollview. Each new element will be added to the bottom of the scrollview. When an element is subtracted/deleted, the elements below it move up to replace the empty space, and the length of the scrollview shortens accordingly. I’d like to be able to do this with an indefinite number of elements. The problem I am running into is that I don’t know how to create unique identifiers for each element. Any thoughts on how to deal with this problem? Any help would be much appreciated.
Not sure if this is what you are looking for, but could you insert a displaygroup in the scrollview and reference each instance by their index?
Perhaps a bit more info on what you’re trying to accomplish will help.
Actually this sounds like a job for a tableView not a scrollView. For a scrollView you are going to have to keep a table of information on each object and when you remove one, you will have to loop through everything in your table and reposition it.
Rob
Thanks Rob, tableView was just the thing.
Not sure if this is what you are looking for, but could you insert a displaygroup in the scrollview and reference each instance by their index?
Perhaps a bit more info on what you’re trying to accomplish will help.
Actually this sounds like a job for a tableView not a scrollView. For a scrollView you are going to have to keep a table of information on each object and when you remove one, you will have to loop through everything in your table and reposition it.
Rob
Thanks Rob, tableView was just the thing.