i have a list of images retrieved from xml i want to populate them to a uiscrollview in an order such that it will look like this.
I think you probably want to wrap your loop in another loop, to get what I'm going to call a 2D loop:
for (int row = 0; row < num_rows; row++) {
for (int col = 0; col < num_cols; col++) {
// code before
zenButton2.frame = CGRectMake(origin x dependent on col,
origin y dependent on row,
width,
height);
// code after
}
}
Where the x
and y
of the CGRectMake()
are multiples of the width and height of your image times the row and column respectively. Hope that makes sense.