Howdy, I've tried a few things here and can't find a solution. The problem is that the previous image will show through in the background if it was longer than the new image. Here's my code. Any help would be appreciated.
Code:
-(IBAction) selectLick:(id)sender {
NSString *titleForButton = [sender titleForState: UIControlStateNormal];
NSString *imagePath = [[NSString alloc] initWithFormat:@"%@.png", titleForButton];
NSString *musicPath = [[NSString alloc] initWithFormat:@"%@.mp3", titleForButton];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imagePath]];
[scrollView setBackgroundColor:[UIColor blackColor]];
[scrollView setCanCancelContentTouches:NO];
scrollView.clipsToBounds = YES;
scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;
[scrollView addSubview:imageView];
[scrollView setContentSize:CGSizeMake(imageView.frame.size.width, imageView.frame.size.height)];
[scrollView setScrollEnabled:YES];
[imagePath release];
[musicPath release];
[imageView release];
//[sender setTitleColor:[UIColor colorWithRed:100/255 green:100/255 blue:100/255 alpha:1.0] forState: UIControlStateNormal];
}