나는 이라는 UIScrollView
의 대리자 인 UIViewController
이 있습니다. scrollview의 대리자를보기 컨트롤러로 설정했지만 scrollview가 스크롤 될 때마다 scrollViewDidScroll:
에 대한 호출이 없습니다.scrollViewDidScroll이 호출되지 않음
UIViewController
헤더 파일 (Game
) :
@interface Game : UIViewController <LocDelegate, UIScrollViewDelegate, ResultsDelegate> {
...
NumberLineScroll* nline;
...
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView;
- (UIView*)viewForZoomingInScrollView:(UIScrollView*)scrollView;
- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale;
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView;
- (void)scrollViewDidEndScrollingAnimation:(UIScrollView *)scrollView;
과 방법이 구현 된 주요 파일의 구성 요소 : 여기
- (void)viewDidLoad {
...
nline = [[NumberLineScroll alloc] initWithFrame: CGRectMake(0, -50, 1024, 400)];
[nline setScrollEnabled:YES];
[nline setContentSize:CGSizeMake(4100, 400)];
[self.view addSubview:nline];
nline.delegate = self;
nline.locDelegate = self; //this is for a Ball imageview that is implemented in NumberLineScroll
...
}
을하고는 UIScrollView
의 구현입니다 여기에 구현입니다 (NumberLineScroll
) :
헤더 파일 :
@interface NumberLineScroll : UIScrollView {
NumberLine* nline;
Ball* ball;
id <UIScrollViewDelegate> delegate;
id <LocDelegate> locDelegate;
}
@property(nonatomic, assign)id <UIScrollViewDelegate> delegate;
@property(nonatomic, assign)id <LocDelegate> locDelegate;
주 파일과 관련성이 높은 것은 없습니다. 스크롤링에 영향을 미치는 유일한 프로그래밍은 바운스를 끄고 볼이 사용자에 의해 이동 될 때 스크롤을 해제 한 다음 끝날 때 다시 스크롤하는 것입니다. 또한 locDelegate
은 문제가되지 않습니다. 주된 문제는 NumberLineScroll
이 위임 호출을하지 않는다는 것입니다. 왜 이런거야?
또한 NumberLineScroll
의 NumberLine
보기는 설명을 위해 스크롤보기의 콘텐츠보기입니다.
좋아, 그게 해결 됐어. 고맙습니다! – RaysonK
당신을 진심으로 환영합니다! – LuisCien