开发者

uiscrollview subclass

just creating a subclass of uiscrollview here and im trying to catch a -(void)scrollViewDidScrollUIScrollView *)scrollView{} in it but for some reason it is not registering.

@interface WallScrollView : UIScrollView{


}

@end

@implementation WallScrollView

-(id)initWithFrame:(CGRect)frame{

    self = [super initWithFrame:frame];

    self.userInteractionEnabled = YES;

    return self;
}

-(void)scrollViewDidScroll:(开发者_如何学编程UIScrollView *)scrollView{
 //some ultra fancy code     
//this code is not called for some reason
}

-(void)dealloc{

    [super dealloc];
}
@end

any ideas as to what im missing or doing wrong here? basically want to catch viewdidscroll. thanks


You do not need to subclass the UIScrollView. Simply implement the - (void)scrollViewDidScroll:(UIScrollView *)scrollView method in your delegate and set the delegate to your scrollview instance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜