0

问题是我在 Xib 制作了一个新的 UIScrollView,然后将委托链接到所有者.. 一些委托如何调用.. 任何线索?或 UIScrollView 的简单示例

对不起,我是一个新的 ios 开发人员,提前感谢..

编码 :

在标题

@interface stageViewController : UIViewController<UIScrollViewDelegate>

在.m

#pragma mark drag delegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
    NSLog(@"scrollViewDidScroll");
}                                              // any offset changes
- (void)scrollViewDidZoom:(UIScrollView *)scrollView{
    NSLog(@"scrollViewDidZoom");
}

// called on start of dragging (may require some time and or distance to move)
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{
    NSLog(@"scrollViewWillBeginDragging");
}

- (void)scrollViewWillEndDragging:(UIScrollView *)scrollView withVelocity:(CGPoint)velocity targetContentOffset:(inout CGPoint *)targetContentOffset{
    NSLog(@"scrollViewWillEndDragging");
}

- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{
    NSLog(@"scrollViewWillBeginDecelerating");
}

- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{
    NSLog(@"scrollViewDidEndDecelerating");
}
4

1 回答 1

3

scrollView.delegate = self;如果你务实地做到了。如果你有你ScrollView的,XIB那么ctrl+drag从你的scrollView到你的File's Owner,然后设置它的代表。

于 2012-07-27T15:35:07.727 回答