1
我正在構建一種幻燈片放映,用戶通過啓用了分頁的scrollView自己滑過圖像。我有一個用於縱向的視圖控制器和一個用於橫向的視圖控制器。縱向視圖控制器對「scrollViewDidEndDecelerating」函數正常工作,但是我在橫向視圖控制器上做了同樣的事情,並且它沒有響應。scrollView委託不工作(scrollViewDidEndDecelerating)
- (void)viewDidLoad {
[super viewDidLoad];
imageNamesArray = [[NSMutableArray alloc] initWithCapacity:LNumImages];
int x = 0;
for(x=0; x<LNumImages;x++) {
[imageNamesArray insertObject: [NSString stringWithFormat:@"kr_Page_%d.png",x+1] atIndex:x];
}
LScrollView.delegate = self;
LScrollView.pagingEnabled = YES;
LScrollView.showsHorizontalScrollIndicator = YES;
LScrollView.contentSize = CGSizeMake(LScrollWidth * LNumImages, LScrollHeight);
[self initImages:0];
}
- (void)LScrollViewDidEndDecelerating:(UIScrollView *)LScrollView {
NSLog(@"stopped");
//does not get called
//[self arangeImages];
}