views:

30

answers:

0

Hello all,

I have 5 UIScrollViews that are loaded into a UIView if a specific button is clicked. Each UIScrollView represents a section, and it contains a UIImageView and also another UIScrollView.

Each time I click on the buttons to load the new "section", the UIImageView brings the new image, but the inner UIScrollView doesn't update with new content. Any suggestions?

*the UIScrollView and the UIImage are defined in IB.

In each section, the code I have is:

-(void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated];

UIImage *image = [UIImage imageNamed:@"Scroll_Project2.png"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:image]; [scrollView addSubview:imageView]; [imageView release];

scrollView.contentSize = CGSizeMake(3042, scrollView.frame.size.height); }

Even if I change the imageNamed to Scroll_Project3.png for the next view, I keep seeing all the time the image Scroll_Project1.png, that is, the scrollview doesn't update.

Thanks a lot for the help.