Hello,
i'm having trouble trying to find out when my scroll view has been moved by the user (by moved i mean has been dragged to the next view)
I found code online that seems to work for everyone ans i was wondering if perhaps i'm doing something wrong and are just not noticing it
In my .h i have
Code:
@interface PhotoViewController : UIViewController <UIScrollViewDelegate>{
IBOutlet UIScrollView *scrollView;
....
}
@property (nonatomic, retain) UIScrollView *scrollView;
...
When I start my viewController I create ImageViews to hold my images and load them
Code:
(void)viewDidLoad {
[super viewDidLoad];
for (int i = 0; i < self.photoCount; i++){
UIImage *image;
UIImageView *imageView;
image = [UIImage imageNamed:@"placeholder.png"];
imageView = [[UIImageView alloc] initWithImage:image];
newWidth = 200.0;
newHeight = 200.0;
CGRect rect = imageView.frame;
rect.size.height = newHeight;
rect.size.width = newWidth;
imageView.frame = rect;
imageView.tag = i;
[scrollView addSubview:imageView];
[imageView release];
}
[self layoutScrollImages]; //center images in scroll view
}
and while searsching i found the follwoing which does nothing when i drag to switch image
Code:
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView {
NSLog(@"3333");
}
- (void)scrollViewDidEndScrollingAnimation: (UIScrollView *)scrollView {
NSLog(@"1111");
}
-(void)scrollViewDidScroll:(UIScrollView *)sender {
NSLog(@"2222");
}
Nothing is being logged...
can anybody please help!!
thanks