问题是我在Xib上创建了一个新的UIScrollView,然后将委托链接到所有者.. 一些代表如何调用..任何线索?或UIScrollView的简单示例
抱歉,我是新的ios开发人员并提前感谢..
代码:
在标题
@interface stageViewController : UIViewController<UIScrollViewDelegate>
at .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");
}
答案 0 :(得分:3)
写scrollView.delegate = self;
如果你是实用的话。
如果您的ScrollView
位于XIB
,然后按住Ctrl +拖动从scrollView
到File's Owner
,然后设置其代理人。