everyone
I got a question , I want to implement a UI , Like iOS desktop , so far I can arrangement
objects via the code below :
int k=0;
int j;
for (int i=0; i<[items count]; i++) {
//k is row
j=i%3;
if (j==0) {
k++;
if (k%3 == 1) {
k = 1;
}
}
[button setFrame:CGRectMake(25+(i%3*95), 35+((k-1)*140), 100, 100)];
So , The view will looks like this
A B C
D E F
G H I
Now , let it into edit mode , drag A drop between E and F
So there are many things need to do
B and C will shift to left , D will go up after B C
E shift left .(how to implement these animations ???)
B C D
E A F
G H I
I search the Apple sample , I only find Moveme this sample , but it only one object
Any advise or sample code will be great help : )
Thanks
Webber
When the user moves a button, you have to find it’s new index first.
Then you have to place it at that index in the items array.
Then you should call the code you provided to reposition the buttons.