Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mrl72

macrumors regular
Original poster
Apr 20, 2008
221
19
I have tableview with it's cells containing buttons, and on each button I load in image within the cellForRowAtIndexPath method. So something like:

Code:
	int i=0,i1=0; 
	
	while(i<noImages){
			UIImage *imageNew = [[UIImage alloc] init] ;
			imageNew=[imageNew maskImage:[UIImage  imageWithContentsOfFile: item.image]];	
			
			UIImage *buttonImageNormal=imageNew;

			[button setBackgroundImage:buttonImageNormal	forState:UIControlStateNormal  ];
			[hlcell.contentView addSubview:button];
	i++;
	}
I have a page full of image thumbnails that are loaded using the method above but they just abruptly appear on the screen. So I would like to display one thumbnail at a time and maybe have them fade up one by one, something like this (at the end of the above):

Code:
			[button setAlpha:0.0f];
			
			[UIView beginAnimations:nil context:NULL];
			[UIView setAnimationDuration:0.75];
			[button setAlpha:1.0f];
			[UIView commitAnimations];

This does in fact work. It fades up the image as it's supposed to. The problem is it fades ALL the images up the same time, which leads me to believe there is no way to do this. Any thoughts?

Cheers.
 
Thanks. Looks like that routine still gets called after the table, cells and buttons have been drawn. Since I'm creating the buttons programatically, I really can't see how to start another animation on the buttons that have already been loaded into the tableview.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.