开发者

UIScrollView overlays NavigationBar

i think my ScrollView is located over my navigation bar.

Because my back button doesn't work and instead my function "handleTouchesOne" is called. I think i have to adjust the height of the scrollView's contentSize but i am doing something wrong.

scrollView.pagingEnabled = YES;
scrollView.contentSize = CGSizeMake(scrollView.frame.size.width * kNumberOfPages, scrollView.frame.size.height);
scrollView.showsHorizontalScrollIndicator = NO;
scrollView.showsVerticalScrollIndicator = NO;
scrollView.scrollsToTop = NO;
scrollView.delegate = self;
scrollView.directionalLockEnabled = YES;

Hope someone 开发者_开发技巧can help me!

edit: how i init my tap gesture:

// One finger single tap

tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTouchesOne:)];
tapGesture.cancelsTouchesInView = NO; 
tapGesture.delaysTouchesEnded = NO;
tapGesture.numberOfTouchesRequired = 1; // One finger single tap
tapGesture.numberOfTapsRequired = 1;
//tapGesture.delegate = self;
[self.view addGestureRecognizer:tapGesture];
[tapGesture release];

Could it be, that the button does not work because the view is over the nav bar or just links my tap to my function ?


In that case you would have to adjust your scroll view's frame, not its contentSize.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜