0
我認爲我的ScrollView位於我的導航欄上。
因爲我的後退按鈕不起作用,而是調用我的函數「handleTouchesOne」。 我想我必須調整scrollView的contentSize的高度,但我做錯了什麼。UIScrollView疊加導航欄
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;
希望有人能幫助我!
編輯:我如何初始化我的點觸手勢:
// 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];
莫非,該按鈕不起作用,因爲該視圖在導航欄或者只是我的自來水鏈接到我的功能?
如果您的滾動視圖是透明的,請放入一些不透明的背景顏色以查看它是否覆蓋您的導航控制器。 – 2011-04-21 15:00:45
似乎它不是scrollview ...當我把紅色的顏色導航欄保持黑色 – madmax 2011-04-21 20:28:59