I am looping through a array and adding UIImageViews, the array has a have different count depending on somethings. So the amount of UIImageViews varies. What I need to do is line them up in a row in the center of the view. I know the code that I need to use its the calculations that I am having an issue with.
for (int i = 0; i < [_lettersArray count]; i++){
UIImage* imageContainer = [UIImage imageNamed:@"container.png"];
UIImageView *containerView = [[UIImageView alloc] initWithImage:imageContainer];
containerView.frame = CGRectMake(???,120,imageContainer.size.width,imageContainer.size.height);
[self.view addSubview:containerView];
}
For your example code it would be something like this: