I\'m using the following code to place some images in the UIView:
UIImage *image;
UIGraphicsBeginImageContext(CGSizeMake(480, 320));
int k=0;
int posY=0;
for (i
You need to add an X offset to your last line of images if it has less than three:
for (int i=0; i<[theArray count]; i++) {
int imagesLeft = min(3, [theArray count] - i);
int offs = (3 - imagesLeft) * 64 / 2;
for (int k = 0; k < imagesLeft; k++) {
image=[UIImage imageNamed:[NSString stringWithFormat:@"%@",[theArray objectAtIndex:i]]];
[image drawAtPoint:CGPointMake(k*64 + offs, posY*23)];
}
posY++;
}